foreach(split //, $a){ if(!(ord($_)>=97 && ord($_)<=122)){ print "wrong symbol\n"; last; } }