title: Unset the key in multidimensional array is not working
body: <p>I am trying to unset the key which is equal to 'null' in my multidimensional array but the codes I've work with is not working so I tried to run it online. But even in online it does not work so I think there is something wrong in my codes. </p>
  
  <p>My link for code is <a href="https://eval.in/591584" rel="nofollow">https://eval.in/591584</a></p>
  
  <p>And this is my array:</p>
  
  <pre><code>$array = array(
  '6' =&gt; array(
      'null' =&gt;array(
          'null'=&gt;array(
                 '11:04'=&gt;array(
                      'id' =&gt; '22'
                  )
          )
      ),
      '1'=&gt;array(
          '2'=&gt;array(
                 '11:04'=&gt;array(
                      'id' =&gt; '22'
                  )
             )
        ),
    )
  );
  </code></pre>
  
  <p>What I want is to remove the key with name <code>null</code>. </p>
  
  <p>The output I want is below where the null key is unset:</p>
  
  <pre><code>$array = array(
  '6' =&gt; array(
      '1'=&gt;array(
          '2'=&gt;array(
                 '11:04'=&gt;array(
                      'id' =&gt; '22'
                  )
             )
        ),
    )
  );
  </code></pre>
  
  <p>The code I've done so far is:</p>
  
  <pre><code> foreach($array as $devp =&gt; $dev){
      foreach($dev as $comp =&gt; $com){
  
        if($comp == null){
           unset($array[$devp][$comp]);
        }
      }
    }
  </code></pre>
  
  <p>But it's not working. I declared this condition <code>($comp == null)</code> as comparing If <code>$comp</code> is equal to null. It should unset the array. What am I missing please help me. </p>