arsort
arsort — Sort an array in descending order and maintain index association.Description
arsort( array &$array,Sorts array in place in descending order, such that its keys maintain their correlation with the values they are associated with.
int $flags = SORT_REGULAR ): bool
This is used mainly when sorting associative arrays where the actual element order is significant.
Note: If two members compare as equal, they retain their original order. Prior to PHP 8.0.0, their relative order in the sorted array was undefined.
Parameters
array
The input array.
flags
The optional second parameter flags.
Return Values
Always returns true.More information about arsort on official PHP documentation site
arsort - Popular snippets
- PHP 7.4 / MySQL 5.7 array_reduce array_merge unserialize array_count_values arsort
last run:
2021-10-20 07:49:30
14
- PHP 8.0 / MySQL 5.7 array_reduce array_merge unserialize array_count_values arsort print_r key
last run:
2021-10-19 18:14:18
5
- PHP 8.0 / MySQL 5.7 array_map strlen arsort array_keys
last run:
2023-03-17 10:34:46
4
- PHP 8.1 / MySQL 5.7 array_map trim array_count_values arsort reset count key
last run:
2022-06-04 05:31:21
4
- PHP 8.1 / MySQL 5.7 array_count_values arsort array_keys
last run:
2022-11-14 09:39:07
3
- PHP 8.1 / MySQL 5.7 explode array_reduce strtolower substr_count arsort print_r
last run:
2022-07-09 16:29:03
3
- PHP 7.4 / MySQL 5.7 array_reduce array_merge unserialize array_count_values arsort
last run:
2021-10-19 18:49:33
3
- PHP 8.0 / MySQL 5.7 array_reduce array_merge unserialize array_count_values arsort print_r key
last run:
2021-10-19 18:06:45
3
- PHP 8.1 / MySQL 5.7 array_merge arsort print_r
last run:
2024-05-30 08:04:35
2
- PHP 8.1 / MySQL 5.7 arsort floor array_sum
last run:
2023-11-16 11:15:47
2
arsort - New snippets
-
PHP 8.1 / MySQL 5.7 array_merge arsort asort print_r
added at:
2024-05-30 08:05:16
1
-
PHP 8.1 / MySQL 5.7 array_merge arsort asort print_r
added at:
2024-05-30 08:05:07
1
-
PHP 8.1 / MySQL 5.7 array_merge arsort print_r
added at:
2024-05-30 08:04:31
2
-
PHP 8.1 / MySQL 5.7 file_get_contents simplexml_load_string json_encode json_decode arsort round
added at:
2023-12-13 18:07:52
1
-
PHP 8.1 / MySQL 5.7 file_get_contents simplexml_load_string json_encode json_decode round arsort
added at:
2023-12-13 18:03:10
1
-
PHP 8.1 / MySQL 5.7 file_get_contents simplexml_load_string json_encode json_decode round arsort
added at:
2023-12-13 18:03:03
1
-
PHP 8.1 / MySQL 5.7 file_get_contents simplexml_load_string json_encode json_decode round arsort
added at:
2023-12-13 18:02:02
1
-
PHP 8.1 / MySQL 5.7 simplexml_load_string json_encode json_decode arsort round
added at:
2023-12-13 17:59:06
1
-
PHP 8.1 / MySQL 5.7 arsort floor array_sum
added at:
2023-11-16 11:15:27
2
-
PHP 8.1 / MySQL 5.7 arsort floor array_sum
added at:
2023-11-16 11:14:27
1