I would like to map values in two arrays which have different shapes, as follows:
$array1=array(
1=>array(1=>'apple', 2=>'banana', 3=>'cherry'),
2=>array(1=>'david', 2=>'eddie', 3=>'frank'),
);
Now:
$array2=array(
1=>'apple',
2=>'banana',
3=>'cherry',
4=>'david',
5=>'eddie',
6=>'frank',
);
Such that when the value of $array1[2][3] is changed from frank to paula for example, then the value of $array2[6] is changed similarly.
How would I do this? NOTE: the keys will not change in quantity once declared.
ArrayObjectthat automaps it might be another option.