$str = "fdsa fsaff  fsdafdsa";
function isspace($str)
{
    if(preg_match("/[ ]+/",$str))
    {
        return true;
    }
    else
    {
        return false;
    }
}
if(isspace($str))
{
    echo "good";
}
else
{
    echo "bad";
}如果是空格的问题那就去掉呗
function repace_space($str)
{
    $str = preg_replace(' ','',$str);
    Return $str;
}