How can the explode function be used to separate numbers in a string in PHP?

To separate numbers in a string in PHP, you can use the explode function to split the string based on a delimiter, such as a space or comma. This will create an array of substrings that were separated by the delimiter. You can then loop through the array to access each individual number. Example:

$string = "10 20 30 40 50";
$numbers = explode(" ", $string);

foreach ($numbers as $number) {
    echo $number . "<br>";
}