if (strstr ($string, " ")) echo "ci sono spazi vuoti!!!";
else echo "stringa senza spazi vuoti";

dovrebbe girare