If you just want to use preg_match() to see if a space is in the string, use:
preg_match ("/ /", "Hello world");
If you want the actual locaction of the space in the string, use:
$text="Hello world";
$textToFind=" ";
$stringPosition=strpos($text,$textToFind);