title: Issue removing a NULL value from MySQL using PHP
body: <p>I've tried the following to remove the null values from a resultset.</p>
  
  <pre><code>if((is_null($value)) || ('NULL' === $value) || (null === $value))
  </code></pre>
  
  <p>none seem to be working.</p>
  
  <p>Here's my full code:</p>
  
  <pre><code>// remove null values from contact details
  $contactData[$key] = removeEmptyDataFromArray($contact);    
  print "&lt;pre&gt;".print_r($contactData[$key],true)."&lt;/pre"&gt;;
  
  // remove empty data function
  function removeEmptyDataFromArray(array $filledData)
  {
      foreach ($filledData as $key =&gt; $value )
      {
          if ((is_null($value)) || (strlen ( $value ) === 0) || ('NULL' == $value) || (NULL === $value))
          {
              unset ( $filledData [$key] );
          }
      }
      return $filledData;
  }
  </code></pre>
  
  <p>And here are the results from my print_r:</p>
  
  <pre><code>firstname :
  lastname :
  middlename :
  primary_emailaddress : someemail@email.com
  </code></pre>