What are some common pitfalls when sorting numerical values in PHP?

One common pitfall when sorting numerical values in PHP is that the default sorting functions may not handle numerical values correctly, especially if they are stored as strings. To avoid this issue, you can use the `SORT_NUMERIC` flag when using the `sort()` function to ensure that the values are sorted numerically.

$numbers = array("10", "2", "30", "5");
sort($numbers, SORT_NUMERIC);
print_r($numbers);