日期:2014-05-17 浏览次数:20553 次
$p1 = '/<(content)>(.*?)<\/\\1>/ise';
$r1 = '"<$1>".htmlspecialchars("$2", ENT_NOQUOTES)."</$1>"';
$p1 = '/<(content)>(.*?)<\/\\1>/ise';<content>abcd>1234</content>
$r1 = '"<$1>".htmlspecialchars("$2", ENT_NOQUOTES)."</$1>"';
echo preg_replace($p1, $r1, '<content>abcd>1234</content>');