How can you sort three numbers in PHP so that one variable contains the largest value, another the middle value, and the third the smallest value?

To sort three numbers in PHP so that one variable contains the largest value, another the middle value, and the third the smallest value, you can use the `sort()` function to sort the numbers in ascending order. Then, you can assign the values to the variables accordingly. The first variable will contain the last element of the sorted array (largest value), the second variable will contain the middle element, and the third variable will contain the first element (smallest value).

$number1 = 25;
$number2 = 10;
$number3 = 18;

$numbers = [$number1, $number2, $number3];
sort($numbers);

$largest = $numbers[2];
$middle = $numbers[1];
$smallest = $numbers[0];

echo "Largest: " . $largest . ", Middle: " . $middle . ", Smallest: " . $smallest;