$string = "handfdfdf dfdfdfdff "; $string = trim($string); if(preg_match('/[[:space:]]/',$string)) { echo "içinde boşluk var"; }