Entity encoding matched text
<?php $html = 'The <b> tag makes text bold: <code><b>bold</b></code>'; print preg_replace('@<code>(.*?)</code>@e',"html_entity_decode('$1')", $html); ?>