OK:
You can check out the function array_merge at php.net but it is also possible to use a simple "+"
i.e. $newarray=$array1+$array2
this would produce different results than:
$newarray= array_merge($array1, $array2)
you'd have to read the documentation (and the comments on the bottom) to get more information.
Unfortunately, you'll have to then sort the array (put it in order) and then extract the first (or last) value as you need it. Quite a bit of work for what you need, but do-able.
Good luck and let me know how it turns out!