What is the purpose of the minmax function in the provided PHP code?

The purpose of the minmax function in the provided PHP code is to find the minimum and maximum values in an array. This function can be used to quickly determine the range of values present in the array.

function minmax($arr){
    $min = min($arr);
    $max = max($arr);
    
    return array($min, $max);
}

// Example usage
$numbers = [5, 10, 3, 8, 15];
$result = minmax($numbers);
echo "Minimum value: " . $result[0] . "<br>";
echo "Maximum value: " . $result[1];