What are common pitfalls to avoid when sorting arrays in PHP?

One common pitfall to avoid when sorting arrays in PHP is not specifying the sorting method. By default, PHP's `sort()` function sorts arrays in ascending order, but if you want to sort in descending order, you need to use the `rsort()` function. Make sure to specify the correct sorting method to avoid unexpected results.

// Incorrect: Sorting in ascending order by default
$numbers = [3, 1, 2];
sort($numbers);
print_r($numbers); // Output: [1, 2, 3]

// Correct: Sorting in descending order
rsort($numbers);
print_r($numbers); // Output: [3, 2, 1]