title: PHP empty field validation
body: <p>I have a enrollment form where users have to input there address. I am using PHP for validation and currently I check to make sure the field is not empty. Here is my code:</p>
  
  <pre><code>if (empty($_POST['address'])) {
      $msg = 'You must enter an address' ;
  } else {
      $address = mysqli_real_escape_string($dbc, strip_tags(trim($_POST['address']))) ;
  }
  </code></pre>
  
  <p>Now the problem is that is the user enters in a "blank" space by pressing the spacebar the filed passes validation. What I need is a way to make sure the user actually typed in a city and not just a blank space or a couple of blank spaces.</p>