iT邦幫忙

0

將html Special Entities (&#開頭)轉成utf-8編碼

preg_replace_callback 簡單範例

$S = "増 我 増 増 増  墑 増 墑 ";

echo $S = preg_replace_callback(
    '/&#(\d+);/i',
    function ($matches) {
         return mb_convert_encoding($matches[0], 'UTF-8', 'HTML-ENTITIES');
    },
    $S
);``

尚未有邦友留言

立即登入留言