在PHP中,可以使用array_reverse()
函數來將數組倒序輸出。示例如下:
$fruits = array("apple", "banana", "cherry", "date");
$reversed_fruits = array_reverse($fruits);
print_r($reversed_fruits);
輸出結果將是:
Array
(
[0] => date
[1] => cherry
[2] => banana
[3] => apple
)