What is the correct way to use the max function in PHP to find the highest number in a string of numbers separated by commas?

When dealing with a string of numbers separated by commas in PHP, you can use the explode function to split the string into an array of numbers. Then, you can use the max function to find the highest number in that array. Finally, you can output the result as needed.

// Sample string of numbers separated by commas
$numbers_string = "5,10,3,8,15";

// Split the string into an array of numbers
$numbers_array = explode(",", $numbers_string);

// Find the highest number in the array
$highest_number = max($numbers_array);

// Output the highest number
echo "The highest number is: " . $highest_number;