Home> 类库下载> PHP类库> body text

PHP array sort

高洛峰
Release: 2016-10-21 11:13:15
Original
1270 people have browsed it

The following only introduces common array sorting methods, please refer to the help manual for detailed instructions


Sort the array by key name: ksort($array)

Sort the array by key name in reverse: krsort($array)

Sort the array Sort and maintain the index relationship: asort($array)

Reverse sort the array and maintain the index relationship: arsort($array)

Reverse sort the array: rsort

Sort the array: sort

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!