What are some common methods for splitting a string into individual words in PHP?

When working with strings in PHP, it is common to need to split a string into individual words. One common method to achieve this is by using the `explode()` function, which allows you to split a string based on a specified delimiter, such as a space. Another method is to use the `preg_split()` function with a regular expression pattern to split the string into words. Additionally, you can use the `str_word_count()` function to count the number of words in a string.

// Using explode() function to split a string into words
$string = "Hello World";
$words = explode(" ", $string);
print_r($words);

// Using preg_split() function with regular expression to split a string into words
$string = "Hello World";
$words = preg_split("/\s+/", $string);
print_r($words);

// Using str_word_count() function to count the number of words in a string
$string = "Hello World";
$word_count = str_word_count($string);
echo $word_count;