Copy CodeThe code is as follows:
Mobile phone number Verification
function Checkmobilevalidity ($mobilephone) {
$exp = "/^13[0-9]{1}[0-9]{8}$|15[012356789]{1}[0-9]{8}$|18[012356789]{1}[0-9]{8}$|14[57]{1}[0-9]$/";
if (Preg_match ($exp, $mobilephone)) {
return true;
}else{
return false;
}
}
Cell phone number Attribution (back to: Guangdong Mobile)
function Checkmobileplace ($mobilephone) {
$url = "http://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=". $mobilephone. " &t= ". Time ();
$content = file_get_contents ($url);
$p = substr ($content, 56, 4);
$mo = substr ($content, 81, 4);
return $str = Conv2utf8 ($p). Conv2utf8 ($MO);
}
Convert string encoding to UTF8
function Conv2utf8 ($text) {
Return mb_convert_encoding ($text, ' UTF-8 ', ' ascii,gb2312,gb18030,gbk,utf-8 ');
}
http://www.bkjia.com/PHPjc/326501.html www.bkjia.com true http://www.bkjia.com/PHPjc/326501.html techarticle Copy the code as follows:? PHP//Mobile number verification function checkmobilevalidity ($mobilephone) {$exp = "/^13[0-9]{1}[0-9]{8}$|15[012356789]{1} [0-9] {8}$|18[012356789]{1}[0-9]{8}$|14[ ...