多维数组搜索

From this array how could I get that array which first element is 128 and the second is 64.

$positions = array(
    array('64','64','home.png','www.sdsd.vf'),
    array('128','64','icon-building64.png','www.sdsd.vf')
);

Thanks for your help Ungi.

foreach($positions as $position) {

   if ($position[0] == '128' AND $position[1] == '64') {
      // This is it!
   }

}

Or you could drop the other members with array_filter().

$positions = array_filter($positions, function($position) {

   return ($position[0] == '128' AND $position[1] == '64');

});

var_dump($positions);

Output

array(1) { [1]=> array(4) { [0]=> string(3) "128" [1]=> string(2) "64" [2]=> string(19) "icon-building64.png" [3]=> string(11) "www.sdsd.vf" } } 

See it.