I won't write the code itself, but you could split the search text searching for spaces, like:
$eachsearch = split(" ", $search);
which would return an array with an item for each word (assuming each word is seperated by a space character). Then you would loop and create the SQL select statement, like:
$sqlstmt = "SELECT * FROM table WHERE"
for ($i = 0; i <= count($eachsearch); $i++)
{
$sqlstmt = $sqlstmt . " AND name LIKE '%$eachsearch($i)%";
}
Bleh, obviously that loop wouldn't work ideally, but I hope that gives you a bit of a hint.
(I'd like to help more, but it's been a while since I've done any PHP programming and I'm rusty.)