如何在PHP中將一個數組的值分配給另一個數組?例如,將一個數組的值分配給另一個數組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 =陣列( '一個'=> '一個', 'B'=> '', 'C'=>」 C」, 'd'=> 'd');
謝謝!
謝謝!有用! – user1480765 2012-07-19 18:26:57