如何将一个数组中的值分配给 PHP 中的另一个数组?例如,
$targetArray = array('a'=>'','b'=>'','c'=>'','d'=>''); //array with empty value
$sourceArray = array('a'=>'a','c'=>'c','d'=>'d'); //array with value, but maybe not have all the keys of the target array
我想看到的结果如下: $resultArray = array('a'=>'a','b'=>'','c'=>'c','d'=>'d' );
谢谢!