/ Published in: Regular Expression

will split the string
"I am" search words
into
[0] => I am
[1] => searching
[2] => words
"I am" search words
into
[0] => I am
[1] => searching
[2] => words
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$split_tags = preg_split( "/[\s,]*\\\"([^\\\"]+)\\\"[\s,]*|[\s,]+/", $search_term, 0, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY );
Comments
