title: How do I remove specific keys from Array? PHP
body: <p>I am trying to remove keys from array.</p>
  
  <p>Here is what i get from printing print_r($cats);</p>
  
  <pre><code>Array
  (
      [0] =&gt; &lt;a href="/website/index.php/Category:All" title="Category:All"&gt;All&lt;/a&gt; &amp;gt; &lt;a href="/website/index.php/Category:Computer_errors" title="Category:Computer errors"&gt;Computer errors&lt;/a&gt; &amp;gt; &lt;a href="/website/index.php/Category:HTTP_status_codes" title="Category:HTTP status codes"&gt;HTTP status codes&lt;/a&gt; &amp;gt; &lt;a href="/website/index.php/Category:Internet_terminology" title="Category:Internet terminology"&gt;Internet terminology&lt;/a&gt; 
      [1] =&gt; 
  &lt;a href="/website/index.php/Category:Main" title="Category:Main"&gt;Main&lt;/a&gt; 
  )
  </code></pre>
  
  <p>I am trying to use this to remove "Main" category from the array</p>
  
  <pre><code>    function array_cleanup( $array, $todelete )
  {
      foreach( $array as $key )
      {
          if ( in_array( $key[ 'Main' ], $todelete ) )
          unset( $array[ $key ] );
  
      }
      return $array;
  }
  
  $newarray = array_cleanup( $cats, array('Main') );
  </code></pre>
  
  <p>Just FYI I am new to PHP... obviously i see that i made mistakes, but i already tried out many things and they just don't seem to work</p>