Advertisement
DArcher

Arrays

Jun 22nd, 2015
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  1. <?php
  2.  
  3. function killIndex($theKeyArray,$theMainArray){
  4.     foreach($theMainArray AS $key => $data){
  5.         if(in_array($key,$theKeyArray)){
  6.             $theMainArray[$key] = null;
  7.             unset($theMainArray[$key]);
  8.         }elseif(is_array($data)){
  9.             $theMainArray[$key] = killIndex($theKeyArray,$data);
  10.         }
  11.     }
  12.    
  13.     return $theMainArray;
  14.    
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement