Hi everyone,
I have an array that looks like this:
Array([5258]=>5274,
[5261]=>5281,
[5264]=>5287,
[5271]=>5289 );
I want to modify this array so that any overlaps in key value pairs are removed.
To elaborate, the first key value pair should become [5258]=>5289
, because the numerical value of the each of the rest of the keys is less than 5274, the original value corresponding to the first key.
What would be the best way to do this using PHP? I'll appreciate some pointers on this.
Thanks.
EDIT: Just a reword to the background for my question: If there's an array like this:
Array([10]=>12
[11]=>15
[16]=>20)
I want to derive another array/modify the same array to get
Array([10]=>15
[16]=>20)
I hope this makes things clearer.