How can I alter this callback so that it sends matches on the keyword “test” in all cases where there is not a “>” character preceeding the keyword? And only matches on the whole word, (ie, does not match on “testing”)
$theContent = preg_replace_callback("/\b('test')\b/i","doReplace", $content);
With a negative lookbehind: