亚洲无码av在线免费观看,国产午夜激无码av片在线观看,久久精品人妻一区二区三区,中文精品久久久久鬼色,体育生GAY爽擼又大又粗的雞巴

宏博網(wǎng)絡(luò) | 專注互聯(lián)網(wǎng)品牌一站式服務(wù)

Thank you for visiting

029-81773686

全網(wǎng)開發(fā)&整合營銷服務(wù)商

CopyRight
?HOOBOO All rights reserved

全網(wǎng)開發(fā)&整合營銷服務(wù)商

029-81773686

看西安網(wǎng)站建設(shè)PHP處理微信昵稱特殊符號過濾方法

2020.07.22

宏博網(wǎng)絡(luò)(西安高端網(wǎng)站建設(shè)公司)在通過PHP獲取微信昵稱,并且存于數(shù)據(jù)庫的時候,由于一些昵稱帶有特殊符號,所以存不進去,這時候小博教你通過下面的方式來處理。

// 方法二

function removeEmoji($clean_text) {

    // Match Emoticons

    $regexEmoticons = '/[\x{1F600}-\x{1F64F}]/u';

    $clean_text = preg_replace($regexEmoticons, '', $clean_text);

 

    // Match Miscellaneous Symbols and Pictographs

    $regexSymbols = '/[\x{1F300}-\x{1F5FF}]/u';

    $clean_text = preg_replace($regexSymbols, '', $clean_text);

 

    // Match Transport And Map Symbols

    $regexTransport = '/[\x{1F680}-\x{1F6FF}]/u';

    $clean_text = preg_replace($regexTransport, '', $clean_text);

 

    // Match Miscellaneous Symbols

    $regexMisc = '/[\x{2600}-\x{26FF}]/u';

    $clean_text = preg_replace($regexMisc, '', $clean_text);

 

    // Match Dingbats

    $regexDingbats = '/[\x{2700}-\x{27BF}]/u';

    $clean_text = preg_replace($regexDingbats, '', $clean_text);

 

    return $clean_text;

}


// 方法二

preg_replace("/[\x{1F600}-\x{1F64F}\x{1F300}-\x{1F5FF}\x{1F680}-\x{1F6FF}\x{2600}-\x{26FF}\x{2700}-\x{27BF}]/u","","這里是昵稱")


// 過濾掉emoji表情

function filterEmoji($str){

$str = preg_replace_callback( '/./u', function (array $match) {

        return strlen($match[0]) >= 4 ? '' : $match[0];

}, $str);

return $str;

}


上一篇:西安網(wǎng)絡(luò)公司,小宏教您PHP如何獲取當前頁面完整URL地址?

下一篇:宏博網(wǎng)絡(luò)HOOBOO(西安高端網(wǎng)站建設(shè))端午節(jié)假日通知

CopyRight ? 西安宏博網(wǎng)絡(luò)科技有限公司   備案號:陜ICP備10007014號-8   站點地圖 免責聲明:本網(wǎng)站部分資源來源于網(wǎng)絡(luò),如有侵權(quán),請聯(lián)系我們告知刪除,我們將會盡快處理,謝謝!本站不承擔任何法律責任。