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)
$array=array( 0 => 0, '1' => 1, 2 => null, 3 => false ); $value=end( $array ); // ← value for first iteration while(($key=key( $array )) !== null) { echo "key=$key, value=$value\n"; $value=prev( $array ); // ← value for next iteration }