title: How to exclude an empty key from array using php?
body: <p>When doing a query in data bank I can receive both arrays as result:</p>
  
  <pre><code>Array
  (
      [] =&gt; 401
      [BETA] =&gt; 223
      [GAMMA] =&gt; 195
      [DELTA] =&gt; 189
  )
  
  Array
  (
      [ALFA] =&gt; 294
      [BETA] =&gt; 223
      [GAMMA] =&gt; 195
      [DELTA] =&gt; 189
  )
  </code></pre>
  
  <p>What can I do to exclude the entirely line when the key is empty?</p>
  
  <p>I tried something like this, but without success:</p>
  
  <pre><code>foreach($array as $key =&gt; $value){
      if(array_key_exists($key, $value) &amp;&amp; is_null($value[$key])) {
          unset($key);
      }
      $array = $value;
  }
  </code></pre>
  
  <p>Many thanks in advance!</p>