Username: Posted September 18, 2010 Share Posted September 18, 2010 How can I block a text that contains only spaces? Right now I have done if ($body == "") { die("<font color='red'><font size='15'><strong><center>Your post did not contain any text!"); } But that's extremely insufficient, as any user can easily post " " Any ideas? Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted September 18, 2010 Share Posted September 18, 2010 $var = trim($var); if(strlen($var) == 0) { // only spaces were in $var } Quote Link to comment Share on other sites More sharing options...
Username: Posted September 18, 2010 Author Share Posted September 18, 2010 $var = trim($var); if(strlen($var) == 0) { // only spaces were in $var } Works great, thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.