在PHP中,有多种排序函数可以使用,比如`sort()`、`rsort()`、`asort()`、`arsort()`等。以下是一些使用这些函数的实例,以及它们的排序顺序。
1. 使用`sort()`函数
`sort()`函数用于对数组中的值进行升序排序。

```php
$numbers = array(5, 2, 8, 1, 4);
sort($numbers);
print_r($numbers);
>
```
| 原始数组 | 排序后的数组 |
|---|---|
| 5,2,8,1,4 | 1,2,4,5,8 |
2. 使用`rsort()`函数
`rsort()`函数用于对数组中的值进行降序排序。
```php
$numbers = array(5, 2, 8, 1, 4);
rsort($numbers);
print_r($numbers);
>
```
| 原始数组 | 排序后的数组 |
|---|---|
| 5,2,8,1,4 | 8,5,4,2,1 |
3. 使用`asort()`函数
`asort()`函数用于对数组中的值进行升序排序,并保持键值关联。
```php
$numbers = array("







