I have this associative array, where key2they key5will always have the same value as key1. Is it possible to set their values by referring to the array itself or to any other suggestions for removing duplication of values?
$arr = array(
'key1' => 'some value',
'key2' => 'some value',
'key3' => 'some other value',
'key4' => 'yet another',
'key5' => 'some value'
);
source
share