I'm trying to parse out individual key words in a string ($dot_afd). However, in the case of "pass", there's a town named "GRANTS PASS" that I don't want to be included. I only want "PASS" highlighted if it doesn't come after the word "GRANTS".
I tried some lookbehind code, but unsuccessful. Here's my code that still highlights "PASS" even if it comes after "GRANTS".
PHP Code:
$patterns[2] = 'PASS';
$replacements = array();
$replacements[2] = '<b><i>PASS </i></b>';
$dot_afd = preg_replace($patterns, $replacements, $dot_afd);
If you have any advice, I would appreciate it. Thanks for your time,
S