htmlentities() 函數把字符轉換為 HTML 實體。
html_entity_decode() 函數把 HTML 實體轉換為字符。
例子:
$a = '<div> <p>11111&&222</p></div>';
$b = htmlentities($a);
$c = html_entity_decode($b);
echo $b."\n";
echo $c;
頁面輸出:
htmlentities輸出內容:<div> <p>11111&&222</p></div>
html_entity_decode輸出內容:11111&&222
---------------------
作者:Goh_Sunny
來源:CSDN
原文:https://blog.csdn.net/qq_34206560/article/details/79488236
版權聲明:本文為博主原創文章,轉載請附上博文鏈接!