PHP krsort() 函数
PHP 教程
· 2019-01-22 19:56:52
实例
对关联数组按照键名进行降序排序:
<?php
$age=array("Peter"=>"35","Ben"=>"37","Joe"=>"43");
krsort($age);
?>
$age=array("Peter"=>"35","Ben"=>"37","Joe"=>"43");
krsort($age);
?>
定义和用法
krsort() 函数对关联数组按照键名进行降序排序。
提示:请使用 ksort() 函数对关联数组按照键名进行升序排序。
提示:请使用 arsort() 函数对关联数组按照键值进行降序排序。
语法
krsort(array,sortingtype);
| 参数 | 描述 |
|---|---|
| array | 必需。规定要进行排序的数组。 |
| sortingtype | 可选。规定如何排列数组的元素/项目。可能的值:
|
技术细节
| 返回值: | 如果成功则返回 TRUE,如果失败则返回 FALSE。 |
|---|---|
| PHP 版本: | 4+ |
点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html
The Haskell School of Music
Paul Hudak、Donya Quick / Cambridge University Press / 2018-10-4 / GBP 42.99
This book teaches functional programming through creative applications in music and sound synthesis. Readers will learn the Haskell programming language and explore numerous ways to create music and d......一起来看看 《The Haskell School of Music》 这本书的介绍吧!