Smilies being parsed in URLs
I'm trying to modify a smilie parser to deal with smilie replacement text appearing in a URL and hence breaking the URL. I've got the following
PHP Code:
foreach ($this->smilieSearchArray as $key=>$value)
{
$parsedText = preg_replace('#(?<!&|"|<|>|©)' . preg_quote($value, '#') . '#s', $this->smilieReplaceArray[$key], $text);
}
This works fine if I remove $value in the preg_replace function and replace it with some hard coded text, the smilie is subsequently shown. However, using $value then the smilie text is not replaced. Both the search and replace arrays are correct as I can echo them and see that they are set up correctly
It's probably something obvious that I'm missing but I just can't see it