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".
If you have any advice, I would appreciate it. Thanks for your time,PHP Code:
$patterns = 'PASS';
$replacements = array();
$replacements = '<b><i>PASS </i></b>';
$dot_afd = preg_replace($patterns, $replacements, $dot_afd);