Trying to use preg_replace to find strings that begin and end with a forward-slash, for example "/Harry/"
. (has to be preg_replace)
I also need to ignore case and ensure it is an individual word. So far I have the following but I am having little luck getting it to work :(
$old_words[0] = '/\b\/Harry\/\b/i';
$new_words[0] = 'Wizard';
$chat = preg_replace($old_words, $new_words, $chat);