PHP Program to rsort() - Sort array in descending alphabetical order

In the following example of PHP program that demonstrates how to use the `rsort()` function to sort an array of strings in descending alphabetical order :
Program :
<?php

// Create an array of strings
$fruits = array("banana", "apple", "orange", "mango");

// Sort the array in descending alphabetical order
rsort($fruits);

// Loop through the sorted array and print the values
foreach($fruits as $fruit) {
    echo $fruit . "<br>";
}

?>
Output :
orange
mango
banana
apple
In this example, we have created an array of strings `$fruits` containing the names of some fruits. We use the `rsort()` function to sort the array in descending alphabetical order.

The sorted array is then looped through using a `foreach` loop and the values of each element are printed to the screen.

The `rsort()` function works in a similar way to the `sort()` function, but sorts the elements in descending order instead of ascending order. It modifies the original array in place and returns a boolean value indicating whether the sort was successful or not.

Note that when sorting an array of strings, `rsort()` uses a case-sensitive comparison by default. If you want to sort the array in a case-insensitive manner, you can use the `natcasesort()` function instead.