depends on what is valid for that input, all white space can be removes with str_repalce(), if however you need to allow it for a space between words use preg repalce to remove more than one in a row:
$str = preg_replace('/\s\s+/', ' ', $str);
after either is done you can just use empty() to check that there was something other than white space entered.