首页 > 解决方案 > Php code to display latest data on top always and push previous values bottom

问题描述

[Problem statement resembles this picture]

https://i.stack.imgur.com/Invsv.png

present output: 1 2 3 4 Expected output: 4 3 2 1 I dont want array_reverse.

标签: php

解决方案


有什么理由不想使用 array_reverse()?

您也可以使用krsort($arr); That 将按键降序排序。


推荐阅读