Advertisement
puggan

sub_array

Aug 11th, 2011
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.23 KB | None | 0 0
  1. <?php
  2.     function sub_array($array, $sub_key)
  3.     {
  4.         $new_array = array();
  5.         if(is_array($array) AND $array)
  6.         {
  7.             foreach($array as $key => $data)
  8.             {
  9.                 $new_array[$key] = $data[$sub_key];
  10.             }
  11.         }
  12.         return $new_array;
  13.     }
  14. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement