How can the explode() function in PHP be used to split a string into individual words in an array?

To split a string into individual words in an array using the explode() function in PHP, you can use a space (' ') as the delimiter. This will separate the string at each space and store each word as an element in the resulting array. You can then access each word in the array using its index.

$string = "Hello world";
$words = explode(" ", $string);
print_r($words);