$full_name = "John Doe"; $name = explode(' ',$full_name); $first_name = $name[0]; $last_name = $name[1];