Is there a way I can check for whitespace?
For example, I DO NOT want to check for whitespace such as this...
$string = "The dog ran away!";
and have it output Thedogranaway!
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!";
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;
}