Get last key-value pair in PHP array
$last = array_slice($array, -1, 1, true);
See http://php.net/array_slice for details on what the arguments mean.
P.S. Unlike the other answers, this one actually does what you want. :-)
try to use
end($array);