I have two arrays like this
$arr1 = Array('fn', 'ln', 'em');
$arr2 = Array('fn'=>'xyz', 'ano' => 'abc', 'ln'=>'122', 'em' => 'a@b.com', 'db'=>'xy');
I want to create an array from arr2 with all the elements from $arr1. So the result should be like this.
$result = Array( 'fn'=>'xyz', 'ln'=>'122', 'em'='a@b.com');
Don’t want to loop.
Any idea?
The order of arguments is important here