Is there an SPL Reverse array iterator in PHP? And if not, what would be the best way to achieve it?
I could simply do
$array = array_reverse($array)
Based on linepogl's answer... You can make it even more efficient by avoiding current() call
current()
for ($value = end($array); ($key = key($array)) !== null; $value = prev($array)) { // ... do something with $key => $value }