title: How to check if $_POST is only whitespace?
body: <p>I'd like to check if $_POST is only whitespaces in case someone hit the space bar and tried to insert empty records in the database. I'd like to do this server side. I'm already checking if it is empty with <code>if ( ! empty( $_POST ) )</code> however, this will be bypassed if I hit the spacebar and enter only whitespaces. I have a piece of code below but I was wondering how to verify all of them without having to hard code every input field name?</p>
  
  <pre><code>if ( ! empty( $_POST ) ) {
     if (ctype_space($_POST['first_name'])) { 
        //return to form with error
     }else{
        //insert in db
     }
  }
  </code></pre>