php自動識別編碼,若里面有中文的話,將其轉(zhuǎn)換為UTF-8就最好了,因為中文在Gbk編輯情況情況下,有可能會亂碼,這個和客戶端和服務(wù)端編碼都有關(guān)系,為了避免亂碼,我們可以使用下面的函數(shù)將其自動轉(zhuǎn)換為UTF8國際標(biāo)準(zhǔn)編碼:
<?php function characet($data){ if( !empty($data) ){ $fileType = mb_detect_encoding($data , array('UTF-8','GBK','LATIN1','BIG5')) ; if( $fileType != 'UTF-8'){ $data = mb_convert_encoding($data ,'utf-8' , $fileType); } } return $data; } ?>
下一篇::獲取網(wǎng)址 title keywords descriptionr的正則表達(dá)式
最新文章
- 1火兔助手
火兔助手......
- 2Access數(shù)據(jù)庫超過2G解決方案
Access數(shù)據(jù)庫操作、管理起來很方便,工作多年......
- 3火兔助手|快手點贊|快手評論
......
- 4微型B2C站點的建立
《微型B2C站點的建立》對于大多數(shù)企業(yè)來說,......
- 5百度優(yōu)化之判斷關(guān)鍵詞是否犯
??關(guān)鍵詞堆砌(keywordstuffing)在網(wǎng)頁中大......