how to remove the last 3 character of a string in php code example Example: php substr remove last 4 characters echo substr($string, 0, -3);