There are two types in php explode()
and preg_split()
Below you can see the difference between the two
In a simple use explode () is much faster,
But preg_split has the advantages of using the tab (\ t) character and space Space with \ s.
and also can use regex to divide into several sections, which can make it heavier
The metacharacter \ s is used to find a blank character
In this case you can see which best to use in your follow up.
One tip, use array_filter to delete empty items in your return array
Example:
$keyword = explode(' ', $_GET['search']); //or preg_split
print_r($keyword);
$keyword = array_filter($arr, 'empty');
print_r($keyword);
**
forum references
p>
**