Advertisement
fernandezekiel

filtering with 2 dimensions

Jan 25th, 2014
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. $attributeMap = [
  2.     'name' => 'Mr. Bean',
  3.     'phone' => '12345' ,
  4.     'pets' => [
  5.         [
  6.             'name'=>'goofy',
  7.             'family'=>'dog'
  8.         ],
  9.         [
  10.             'name'=>'twitty',
  11.             'family'=>'dinosaur'
  12.         ]
  13.     ]
  14. ];
  15.  
  16. $filter = ['name','phone','pets' => ['name']];
  17.  
  18. // i wanted to use the $filter to make attributeMap look like this:
  19. // ['name'=>'Mr. Bean', 'phone' => '12345', 'address'=>['city'=>'hogs']]
  20.  
  21. // what i was only able to do is to create a 1 dimensional filter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement