1818IP-服务器技术教程,云服务器评测推荐,服务器系统排错处理,环境搭建,攻击防护等

当前位置:首页 - 网站技术 - php - 正文

君子好学,自强不息!

实例说明:

<!DOCTYPE html>
<html>
<body>
<?php
$cars=array("Volvo","BMW","Toyota");
rsort($cars);
$clength=count($cars);
for($x=0;$x<$clength;$x++)
   {
   echo $cars[$x];
   echo "<br>";
   }
?>
</body>
</html>

标签含义:

rsort:函数对数值数组进行降序排序。

sort :函数对数值数组进行升序排序。

源代码运行结果如下:

image.png



本文来源:1818IP

本文地址:https://www.1818ip.com/post/2508.html

免责声明:本文由用户上传,如有侵权请联系删除!

发表评论

必填

选填

选填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。