[reg-ex newbee]
I have this function from another thread here:
$keywords = "hel or ow r o oda";
$search_data = "hello world how are you today";
$searchWords = explode(' ', $keywords);
array_walk($searchWords, create_function('&$v, $k', '$v = "/\\b$v\\b/i";'));
$search_results = preg_replace($searchWords, '<strong>\\0</strong>', $search_data);
echo $search_results;
I want the result to look like this:
hello world how are you today