欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

PHP html_entity_decode() 函數(shù)

定義和用法

html_entity_decode() 函數(shù)把 HTML 實(shí)體轉(zhuǎn)換為字符。

html_entity_decode() 是 htmlentities() 的反函數(shù)。

語法

html_entity_decode(string,quotestyle,character-set)
參數(shù) 描述
string 必需。規(guī)定要解碼的字符串。
quotestyle

可選。規(guī)定如何解碼單引號和雙引號。

  • ENT_COMPAT - 默認(rèn)。僅解碼雙引號。
  • ENT_QUOTES - 解碼雙引號和單引號。
  • ENT_NOQUOTES - 不解碼任何引號。
character-set

可選。字符串值,規(guī)定要使用的字符集。

  • ISO-8859-1 - 默認(rèn)。西歐。
  • ISO-8859-15 - 西歐(增加 Euro 符號以及法語、芬蘭語字母)。
  • UTF-8 - ASCII 兼容多字節(jié) 8 比特 Unicode
  • cp866 - DOS 專用 Cyrillic 字符集
  • cp1251 - Windows 專用 Cyrillic 字符集
  • cp1252 - Windows 專用西歐字符集
  • KOI8-R - 俄語
  • GB2312 - 簡體中文,國家標(biāo)準(zhǔn)字符集
  • BIG5 - 繁體中文
  • BIG5-HKSCS - Big5 香港擴(kuò)展
  • Shift_JIS - 日語
  • EUC-JP - 日語

提示和注釋

提示:無法被識別的字符集將被忽略,并由 ISO-8859-1 代替。

例子

<?php
$str = "John &amp; &#039;Adams&#039;";
echo html_entity_decode($str);
echo "<br />";
echo html_entity_decode($str, ENT_QUOTES);
echo "<br />";
echo html_entity_decode($str, ENT_NOQUOTES);
?>

瀏覽器輸出:

John & 'Adams'
John & 'Adams'
John & 'Adams'

如果在瀏覽器中查看源代碼,會看到這些 HTML:

<html>
<body>
John & &#039;Adams&#039;<br />
John & 'Adams'<br />
John & &#039;Adams&#039;
</body>
</html>