Page is a not externally linkable
dreamcatcher - 2:46 pm on Nov 30, 2009 (gmt 0)
$string = 'James Carpenter Robertson'; You can also use strrpos [php.net] to get the last occurence of a space. Combine this with substr [php.net] and strlen [php.net]: $string = 'James Carpenter Robertson'; dc
Easiest way for last name is to use explode [php.net]
$name = explode(' ',$string);
echo $name[count($name)-1)];
echo substr($string,strrpos($string, ' '),strlen($string));