代码示例:(标识:demo_php_array_rsort_alpha)
<!DOCTYPE html>
<html>
<body>

<?php
$cars=array("porsche","BMW","Volvo");
rsort($cars);

$clength=count($cars);
for($x=0;$x<$clength;$x++)
   {
   echo $cars[$x];
   echo "<br>";
   }
?>

</body>
</html>
运行结果: