Loading…

How to get elements in reverse order of an array in php?

For this we can use array_reverse() function.

Example

                                        

$array = array("1"=>"Best","2"=>"Interview","3"=>"Question");
print_r(array_reverse($array));

// OUTPUT Array ( [3] => Question [2] => Interview[1] => Best)

Suggest An Answer

No suggestions avaliable!

Latest post from PHP Arrays

Ask Question