Wondering if I could get some advice on tokenizing a string in php since Im relatively new to the language.
I have this:
$full_name = "John Smith"
I want to use a string function that will extract the first name and last name into indices of an array.
$arr[0] = "John"
$arr[1] = "Smith"
However, the function should also be able to handle the situation:
$full_name = "John Roberts-Smith II"
$arr[0] = "John"
$arr[1] = "Roberts-Smith II"
or
$full_name = "John"
$arr[0] = ""
$arr[1] = "John"
any suggestions on where to begin?