Separate First and Last Name

0
0
$name = "John S Smith";

list($fname, $lname) = split(' ', $name,2);

echo "First Name: $fname, Last Name: $lname";

Works with or without middle name.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.