I have this two arrays:
$arr1=array( array("id" => 8, "name" => "test1"),
array("id" => 4, "name" => "test2"),
array("id" => 3, "name" => "test3")
);
$arr2=array( array("id" => 3),
array("id" => 4)
);
How can i "extract" arrays from $arr1, where id have same value in $arr2, into a new array and leave the extracted array also in a new array, without taking into account key orders?
The output i am looking for should be:
$arr3=array(
array("id" => 8, "name" => "test1")
);
$arr4=array( array("id" => 4, "name" => "test2"),
array("id" => 3, "name" => "test3")
);
Thanks