Quote escaping in backreference replacements
<?php
$html = "<code><b> It's bold </b></code>";
print preg_replace('@<code>(.*?)</code>@e',"html_entity_decode('$1')", $html);
print "\n";
$html = '<code><i> "This" is italic. </i></code>';
print preg_replace('@<code>(.*?)</code>@e',"html_entity_decode('$1')", $html);
print "\n";
?>
Related examples in the same category