How can I get the last 5 elements of a PHP array?
My array is dynamically generated by a MySQL query result. The length is not fixed. If the length is smaller or equ
array_slice($array, -5) should do the trick
($array, -5)