Php asort
From w3cyberlearnings
Contents |
PHP function asort
This function sorts array by using the array's values.
Syntax asort
- array: array input
asort(array);
Example 1
<?php $country = array( 'USA' => 80, 'CHINA' => 61, 'VIETNAME' => 434, 'INDIA' => 135 ); asort($country); print_r($country); ?>
Output
Array ( [CHINA] => 61 [USA] => 80 [INDIA] => 135 [VIETNAME] => 434 )
Related Links
- array_change_key_case
- array_chunk
- array_combine
- array_count_values
- array_diff_assoc
- array_diff_key
- array_diff_uassoc
- array_diff_ukey
- array_diff
- array_fill_keys
- array_fill
- array_filter
- array_flip
- array_intersect_assoc
- array_intersect_key
- array_intersect_uassoc
- array_intersect_ukey
- array_intersect
- array_key_ exists
- array_keys