I'm not exactly sure what you mean, but this is what I think.
If you want to check if the user has inputted their full name (First name and Surname) then,
$name = trim($name);
eregi(" ", $name);
will guarantee that if there's a space in there, there's text either side.
Hope this helps