I\'m looking for the best reliable way to return the first and last name of a person given the full name, so far the best I could think of is the following
Here is simple non regex way
$name=explode(" ",$name); $first_name=reset($name); $last_name=end($name); $result=$first_name.' '.$last_name;