1 回答

TA貢獻(xiàn)1862條經(jīng)驗(yàn) 獲得超7個(gè)贊
方法/步驟
1
htmlspecialchars()轉(zhuǎn)義特別的字符為HTML實(shí)體;
'&' (ampersand) becomes '&' '"' (double quote) becomes '"' when ENT_NOQUOTES is not set. ''' (single quote) becomes ''' only when ENT_QUOTES is set. '<' (less than) becomes '<' '>' (greater than) becomes '>'
2
htmlspecialchars_decode()將實(shí)體轉(zhuǎn)成HTML代碼,函數(shù)1的反函數(shù)。
3
htmlentities()
這個(gè)是全部轉(zhuǎn)換html實(shí)體,和htmlspecialchars()區(qū)別在于,這個(gè)函數(shù)是轉(zhuǎn)義全部的字符,而htmlspecialchars()僅僅轉(zhuǎn)義上面限定的5個(gè)特殊字符!
html_entity_decode() 函數(shù)
把 HTML 實(shí)體轉(zhuǎn)換為字符。
- 1 回答
- 0 關(guān)注
- 166 瀏覽
添加回答
舉報(bào)