我有两个长度相同的数组,其中包含一些值。
$a = array("a","b","x","x");
$b = array("f","g","g","h");
现在我想$b从 where $ais的索引位置获取值x。
$ids = array_keys($a, 'x');
$res = ???($b,$ids);
print_r($res);
那么什么函数会给我一个包含gand的数组h。还是有更优雅的(例如不使用array_keys())来做到这一点?