0

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' );

ありがとうございました!

4

3 に答える 3