Matching an array value by key in PHP

ucuksx

New Member
I have an array of items:\[code\]array( [0] => array( 'item_no' => 1 'item_name' => 'foo ) [1] => array( 'item_no' => 2 'item_name' => 'bar' )) etc. etc.\[/code\]I am getting another array from a third party source and need to remove items that are not in my first array.\[code\]array( [0] => array( 'item_no' => 1 ) [1] => array( 'item_no' => 100 ) # should be removed as not in 1st array\[/code\]How would I search the first array using each item in the second array like (in pseudo code):if 'item_no' == x is in 1st array continue else remove it from 2nd array.
 
Back
Top