$in = '(<(/?(?:strong|p|em|a|ol|ul|li|img|iframe)\b.*?)>)ie';
$contenu = preg_replace($in, "'<'.html_entity_decode('$1',ENT_QUOTES,'UTF-8').'>'", $contenu);
答案 0 :(得分:0)
$pattern = '~<(/?(?:strong|p|em|a|ol|ul|li|img|iframe)\b.*?)>~is';
$contenu = preg_replace_callback($pattern, function ($m) {
return '<' . html_entity_decode($m[1], ENT_QUOTES, 'UTF_8') . '>'; }, $contenu);