All pastes #802220 Raw Edit

Stuff

public text v1 · immutable
#802220 ·published 2007-11-30 00:16 UTC
rendered paste body
$array1 = array (
	[474] => 482,
	[496] => 208
)

$array2 = array (
	[474] => 474,
	[496] => 496,
	[496] => 496
)

I would like replace each array2 key by the same key in array1 if it exists.

So,

array3 (result) should be

$array3 = array (
	[474] => 482,
	[496] => 208,
	[496] => 496
)