title: Updating date to present if null or empty php
body: <p>I'm trying to set the date using PHP's <code>date('Y-m-d')</code> if the variable is empty or null. The variable is delivered from a <code>Jquery-Jtable edit form</code>. Then I have an elaborate if statement which checks if the variable is empty or null:</p>
  
  <pre><code>if ( !isset($data['date_closed']) || strlen($data['date_closed']) == 0 
       || !$data['date_closed'] || $data['date_closed'] == "0000-00-00" 
       || $data['date_closed'] == NULL || is_null($data['date_closed']) 
       || empty($data['date_closed']) ) {
              $date['date_closed'] = date('Y-m-d');
  }
  </code></pre>
  
  <p>I have desperately added every check that I could find to make it work but it hasn't. The final value getting stored in the DB is <code>000-00-00</code>. Just the to make sure that my changes were being registered I typed just this line:</p>
  
  <pre><code>$date['date_closed'] = date('Y-m-d');
  </code></pre>
  
  <p>and the date got updated to the DB as today's date. </p>
  
  <p>All help is greatly appreciated.</p>