I have a single "name" input field, and when submitted I want to look for the first space in the name, put anything before it into a "firstname" field, and anything after it into "surname".
At the moment I'm doing it like this (because its the only way I know how):
Code: Select all
<?
$fullnameexplode = explode(' ', $fullname);
$firstname=$fullnameexplode[0];
$surname=$fullnameexplode[1];
?>