What are the differences between using ASC and DESC in sorting data with PHP?

When sorting data in PHP, using ASC (ascending order) will sort the data in increasing order, while using DESC (descending order) will sort the data in decreasing order. ASC is the default sorting order if not specified.

// Sorting an array in ascending order
$numbers = [5, 2, 8, 1, 3];
sort($numbers);
print_r($numbers); // Output: [1, 2, 3, 5, 8]

// Sorting an array in descending order
$numbers = [5, 2, 8, 1, 3];
rsort($numbers);
print_r($numbers); // Output: [8, 5, 3, 2, 1]