Ben boşlukla kontrol edebilirsiniz bir yolu var mı?
For example, I DO NOT bu gibi boşlukla kontrol etmek istiyorum ...
$string = "The dog ran away!";
and have it output Thedogranaway!
strong>
I want to check if there if the entry is ALL whitespace and whitespace only?
...and have it output the error!
Basically, I don't want to be able to enter all whitespace, and still have it do the mysql_query.
Also, is there a way I can strip all the whitespace before the string, and not from the rest of the string?
$string = " "WHITESPACE HERE" The dog ran away!";
strong>
if(empty($string) OR $string == " "){ // crappy example of what i'm trying to do
echo "Try again, please enter a message!"; // error
} else {
mysql_query("UPDATE users SET mesg='$string'")or die(mysql_error()); // do something
echo $post;
}