PHP sort() 函数
PHP 教程
· 2019-01-22 23:12:00
实例
对数组 $cars 中的元素按字母进行升序排序:
$cars=array("Volvo","BMW","Toyota");
sort($cars);
定义和用法
sort() 函数对数值数组进行升序排序。
提示:请使用 rsort() 函数对数值数组进行降序排序。
语法
sort(array,sortingtype);
| 参数 | 描述 |
|---|---|
| array | 必需。规定要进行排序的数组。 |
| sortingtype | 可选。规定如何排列数组的元素/项目。可能的值:
|
技术细节
| 返回值: | 如果成功则返回 TRUE,如果失败则返回 FALSE。 |
|---|---|
| PHP 版本: | 4+ |
更多实例
实例 1
对数组 $numbers 中的元素按数字进行升序排序:
<?php
$numbers=array(4,6,2,22,11);
sort($numbers);
?>
$numbers=array(4,6,2,22,11);
sort($numbers);
?>
点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html
Algorithms for Image Processing and Computer Vision
Parker, J. R. / 2010-12 / 687.00元
A cookbook of algorithms for common image processing applications Thanks to advances in computer hardware and software, algorithms have been developed that support sophisticated image processing with......一起来看看 《Algorithms for Image Processing and Computer Vision》 这本书的介绍吧!