문제

$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);
도움이 되었습니까?

해결책

$pattern = '~&lt;(/?(?:strong|p|em|a|ol|ul|li|img|iframe)\b.*?)&gt;~is';

$contenu = preg_replace_callback($pattern, function ($m) {
    return '<' . html_entity_decode($m[1], ENT_QUOTES, 'UTF_8') . '>'; }, $contenu);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top