I have 2 arrays:
$array1 = array(1 => '12', 2 => '4', 3 => '54');
$array2 = array(1 => '12', 2 => '4', 3 => '54', 4 => '124');
How would I go about making $array2 have the same number of keys as $array1, and removing any at the end.
So, I would end up with:
$array2 = array(1 => '12', 2 => '4', 3 => '54');
Being aware that the first array may contain a different number of keys.