創(chuàng)新互聯(lián)www.cdcxhl.cn八線動態(tài)BGP香港云服務(wù)器提供商,新人活動買多久送多久,劃算不套路!
這篇文章運用簡單易懂的例子給大家介紹php如何實現(xiàn)html標簽的轉(zhuǎn)義,代碼非常詳細,感興趣的小伙伴們可以參考借鑒,希望對大家能有所幫助。
在php中可以使用“htmlentities”函數(shù)轉(zhuǎn)義html標簽,該函數(shù)用于把字符轉(zhuǎn)換為HTML實體,其語法是“htmlentities(string,flags,character-set,double_encode)”。
PHP 之Html標簽轉(zhuǎn)義與反轉(zhuǎn)義
1、htmlentities()函數(shù)轉(zhuǎn)義html
2、html_entity_decode()函數(shù)反轉(zhuǎn)義html
一:htmlentities() 函數(shù)把字符轉(zhuǎn)換為 HTML 實體。
提示:要把 HTML 實體轉(zhuǎn)換回字符,請使用 html_entity_decode() 函數(shù)。
提示:請使用 get_html_translation_table() 函數(shù)來返回 htmlentities() 使用的翻譯表。
語法
htmlentities(string,flags,character-set,double_encode)
二:html_entity_decode() 函數(shù)把 HTML 實體轉(zhuǎn)換為字符。
html_entity_decode() 函數(shù)是 htmlentities() 函數(shù)的反函數(shù)。
語法
html_entity_decode(string,flags,character-set)
關(guān)于php如何實現(xiàn)html標簽的轉(zhuǎn)義就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。
網(wǎng)頁標題:php如何實現(xiàn)html標簽的轉(zhuǎn)義-創(chuàng)新互聯(lián)
文章路徑:http://vcdvsql.cn/article6/djjiog.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站收錄、網(wǎng)站維護、品牌網(wǎng)站建設(shè)、網(wǎng)站營銷、網(wǎng)站策劃、網(wǎng)站內(nèi)鏈
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容