How can you best approach sorting arrays in PHP, especially when adding new elements?

When sorting arrays in PHP, especially when adding new elements, it's best to use built-in functions like `sort()` or `asort()` to maintain the order of elements. These functions will automatically re-sort the array after adding new elements. Additionally, you can use functions like `array_push()` or direct assignment to add new elements to the array.

// Example of sorting an array in PHP and adding new elements

// Define an array
$numbers = [5, 3, 8, 1, 2];

// Sort the array in ascending order
sort($numbers);

// Add a new element to the array
$numbers[] = 6;

// Sort the array again to maintain order
sort($numbers);

// Print the sorted array
print_r($numbers);