$a=array(56,7,6,8,5,34);
$b=array(
array(6,"34er34",44),
array(8,"34d34",44),
array(7,"343th4",44),
array(34,"343d4",44),
array(56,"3434",44),
array(5,"343gh4",44));
$d=array_column($b,0);
var_dump($d);
$g=[];
foreach($a as $c)
{
$f=array_search($c,$d);
if($f!==false)
$g[]=$b[$f];
}
var_export($g);
Sort keys of an array based on order of values in another array – PHP
by
Tags:
Leave a Reply