PHP头条
热点:

正则替换全角字符-PHP源码


php代码

function zo_replace(text) {
    return text && text.replace(/[\u3000\uff01-\uff5f]/g, function($0) {
        return $0 == "\u3000" ? " " : String.fromCharCode($0.charCodeAt(0) - 0xfee0);
    });
}

www.phpzy.comtrue/php/33957.htmlTechArticle正则替换全角字符-PHP源码 php代码 function zo_replace(text) { return text text.replace(/[\u3000\uff01-\uff5f]/g, function($0) { return $0 == "\u3000" ? " " : String.fromCharCode($0.charCodeAt(0) - 0xfee0); });}...

相关文章

PHP之友评论

今天推荐