Guest User

rec

a guest
Oct 24th, 2014
5
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. Flight::map('recursiveRemoval',function(&$array, $rKey){
  2. if(is_array($array))
  3. {
  4. foreach($array as $key=>&$arrayElement)
  5. {
  6. if(is_array($arrayElement))
  7. {
  8. Flight::recursiveRemoval($arrayElement, $rKey);
  9. }
  10. else
  11. {
  12. if($key == $rKey)
  13. {
  14. unset($array[$rKey]);
  15. }
  16. }
  17. }
  18. }
  19. });
  20.  
  21.  
  22. $tmp = array('text','name');
  23.  
  24. Flight::recursiveRemoval($tmp, 'text');
Advertisement
Add Comment
Please, Sign In to add comment