How to split words in string to an array using regular expressions. You can use this for search indexing for an example.
Source code viewer
$input = 'How to split words in string to an array using regex.'; foreach ($matches as $match) { $phrase = false; // Strip off phrase quotes. if ($match[2]{0} == '"') { $phrase = true; } foreach ($words as $word) { } }Programming Language: PHP