What are the potential pitfalls of splitting search terms in PHP using explode() when dealing with phrases?

When splitting search terms in PHP using explode() for phrases, the potential pitfall is that the function will split the phrase into individual words, which may not be the desired behavior. To solve this issue, you can use preg_split() with a regular expression pattern to split the phrase while preserving the phrase as a whole.

$searchTerm = "apple pie";
$terms = preg_split('/\s+/', $searchTerm, -1, PREG_SPLIT_NO_EMPTY);