title: PHP check if user typed something in text input
body: <p>I have a few simple html text inputs.  I would like to check that the user inputted something and not just spaces.  My code below isn't working.</p>
  
  <p>HTML (in a form):</p>
  
  <pre><code>&lt;input type='text' name='email' id='email' /&gt;
  </code></pre>
  
  <p>PHP (the "action" page of the form):</p>
  
  <pre><code>$email=mysql_real_escape_string(strtolower(trim($_POST['email'])));
  
      if (!$email || empty($email)){    // these are the checks that don't work
             echo "no email entered";
       }
  </code></pre>