Specify a negative number as parameter three for the length
<? $string = "Goodbye, Perl!"; $a = substr($string, 5, 5); $b = substr($string, 5, -1); $c = substr($string, 0, -7); ?>