What function can be used to sort an array in PHP?

To sort an array in PHP, you can use the `sort()` function. This function sorts an array in ascending order based on its values. If you need to sort an array in descending order, you can use the `rsort()` function. Both functions modify the original array.

$numbers = [4, 2, 8, 5, 1];
sort($numbers);
print_r($numbers);