htmlentities — 将字元轉換為 HTML 轉義字元
說明
htmlentities ( string
$string
[, int
$flags
= ENT_COMPAT | ENT_HTML401 [, string
$encoding
= ini_get("default_charset") [, bool
$double_encode
= true ]]] ) : string
本函數各方面都和 htmlspecialchars() 一樣, 除了 htmlentities() 會轉換所有具有 HTML 實體的字元。
如果要解碼(反向操作),可以使用 html_entity_decode()。
參數
-
string
-
flags