chirag
answered Jul 17 '21 00:00
if the text string is like "firstname lastname" than we can use space as separator and we divide the text by space and get the first name and last name
so to divide the text by space , use explode() function in PHP
$fullname="Sachin tendulkar";
$name=explode(" ",$fullname);
echo $name[0];//give you firstname which is Sachin
echo $name[1];//will print last name which is tendulkar in our case.