sort
sort — Sort an array in ascending order.Description
sort( array &$array,Sorts array in place by values in ascending order.
int $flags = SORT_REGULAR ): bool
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.
This function assigns new keys to the elements in array. It will remove any existing keys that may have been assigned, rather than just reordering the keys.
Resets array's internal pointer to the first element.
Parameters
Return Values
Always returns true.More information about sort on official PHP documentation site
sort - Popular snippets
- PHP 8.2 / rand print_r sort array_count_values
last run:
2023-08-22 16:55:49
60
- PHP 8.2 / rand print_r sort array_count_values
last run:
2023-08-22 16:28:07
29
- PHP 8.2 / rand print_r sort array_count_values
last run:
2023-08-22 16:29:09
11
- PHP 8.0 / print_r sort
last run:
2023-05-23 13:04:12
8
- PHP 8.1 / sort memory_get_peak_usage range
last run:
2024-01-02 19:50:03
7
- PHP 8.1 / array_map explode sort print_r
last run:
2022-05-11 03:24:50
6
- / array_shift sort preg_match
last run:
2022-03-31 06:16:50
6
- PHP 8.1 / sort memory_get_peak_usage range
last run:
2024-01-02 19:51:46
4
- PHP 8.1 / rand sort print_r
last run:
2023-08-22 14:22:47
4
- PHP 8.1 / sort json_encode
last run:
2023-03-16 19:28:58
4
sort - New snippets
-
PHP 8.4 / MariaDB 11.4 asort sort print_r
added at:
2025-06-13 18:19:26
1
-
PHP 8.4 / MariaDB 11.4 sort print_r
added at:
2025-06-13 18:06:47
1
-
PHP 8.4 / MySQL 8.0 sort print_r rsort
added at:
2025-05-06 10:34:42
1
-
PHP 8.4 / MySQL 8.0 sort
added at:
2025-05-06 10:33:40
1
-
PHP 8.4 / MySQL 8.0 sort
added at:
2025-05-06 10:33:35
2
-
PHP 8.4 / MySQL 8.0 sort
added at:
2025-05-06 10:33:10
1
-
PHP 8.4 / MySQL 8.0 sort
added at:
2025-05-06 10:32:59
1
-
PHP 8.4 / MySQL 8.0 sort
added at:
2025-05-06 10:32:45
1
-
PHP 8.4 / MySQL 8.0 sort ctype_digit implode count var_export
added at:
2025-04-03 04:55:46
1
-
PHP 8.4 / MySQL 8.0 sort ctype_digit implode count var_export preg_replace
added at:
2025-04-02 00:20:27
1