- When I use preg_replace with the e modifier, the replaced text seems to get extraneous slashes added to it.
For example, when I add emoticons like this:
$data = preg_replace('/ ([:8=][^\\s]+?) /e', '(($emoticons[\'$1\']) ? (\'<!--I$1--><img src="\' . $emoticons[\'$1\'] . \'" class="emot" />\') : \'$1\')', $data);
something like ="" (which is in HTML tags, it's not an emoticon) gets converted to =\"".
This is fixed when I change the \'$1\' to "$1". Does the e modifier expect back references to be quoted in double quotes, not single? I'd like to understand what's causing this.
(Disregard question #2, I think I've found the problem.)