A practical PHP function code, regular expression verification of the correctness of the phone number and query phone number attribution, the following look at the function of the specific code:
View SOURCEPRINT?01
02//Mobile phone Number verification
03function checkmobilevalidity ($mobilephone) {
04$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]$/";
05if (Preg_match ($exp, $mobilephone)) {
06return true;
07}else{
08return false;
09}
10}
11//Cell phone number attribution
12function Checkmobileplace ($mobilephone) {
13$url = "http://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=". $mobilephone. " &t= ". Time ();
14$content = file_get_contents ($url);
15$p = substr ($content, 56, 4);
16$mo = substr ($content, 81, 4);
17return $str = Conv2utf8 ($p). Conv2utf8 ($MO);
18}
19?>
Search cell phone ownership is called Taobao's mobile phone ownership resources, please note that this page address, if the failure, you can find the correct address Taobao.