I'm doing a query to my DB, and we can make an identical query to this:
"hello world" "pacific ocean"
What happens is that I can search multiple strings at once:
Expected result:
String1: Hello world
string2: pacific ocean
Strings are divided by a space, but must be enclosed in quotation marks.
I have the following code:
$array_seach = explode($search_word, " ");
The problem with this is that it will cut into the first whitespace you find, rather than separating the string. I have also tried but with no result:
$array_seach = explode($search_word, " \"");
$array_seach = explode($search_word, ' \"');
Given that I do not know the number of strings or what is written, how can I solve this?