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.0 / MySQL 5.7 array_map strlen arsort print_r
last run:
2023-03-17 09:52:05
2
- PHP 8.1 / MySQL 5.7 print_r array_count_values arsort
last run:
2022-11-13 18:29:07
2
arsort - New snippets
-
PHP 8.2.3 / MySQL 8.0 arsort print_r krsort
added at:
2023-05-23 13:34:15
1
-
PHP 8.1 / MySQL 5.7 explode substr_count arsort key
added at:
2023-04-07 22:55:07
1
-
PHP 8.1 / MySQL 5.7 strpos arsort key
added at:
2023-04-07 13:22:40
1
-
PHP 8.1 / MySQL 5.7 strpos arsort key
added at:
2023-04-07 13:17:16
1
-
PHP 8.1 / MySQL 5.7 strpos arsort key
added at:
2023-04-07 13:17:02
1
-
PHP 8.1 / MySQL 5.7 strpos arsort key
added at:
2023-04-07 13:15:08
1
-
PHP 8.1 / MySQL 5.7 explode strpos arsort key
added at:
2023-04-07 13:11:21
1
-
PHP 8.1 / MySQL 5.7 explode strpos arsort key
added at:
2023-04-07 13:11:07
1
-
PHP 8.0 / MySQL 5.7 array_map strlen arsort array_keys print_r
added at:
2023-03-17 10:36:35
1
-
PHP 8.0 / MySQL 5.7 array_map strlen arsort array_keys print_r
added at:
2023-03-17 10:36:14
1