title: Get keys of an array where values is not NULL in PHP
body: <p>I have an associative array in PHP</p>
  
  <pre><code>$a = array("d1" =&gt; "data", "d2" =&gt; NULL, "d3" =&gt; "data")
  </code></pre>
  
  <p>I want to get all keys and all values which are not NULL, in order to implode them:</p>
  
  <pre><code>// e.g.:
  $sub_key    = array_keys($a, keys != NULL);
  $sub_values = array_values($a, values != NULL);
  
  echo "`".implode("`,`", $sub_key)."`";
  echo "'".implode("','", $sub_key)."'";
  </code></pre>
  
  <p>Are there functions like <code>array_keys()</code> and <code>array_values()</code> that allow to take only vales that do <strong>not</strong> match the pattern?</p>