The mobile phone number is used to query the code from the specified location. This mobile phone number attribution query code is a php open-source mobile phone attribution query system, the system does not rely on mysql and other large databases, but rely on text, because, generally, a mobile phone number is a php open-source mobile phone ownership query system. The system does not rely on large databases such as mysql, but on text. generally, a mobile phone number, the first seven digits play a decisive role in the query system
Mobile phone number retrieval code
/*
This mobile phone number attribution query code is a php Tutorial open-source mobile phone attribution query system, the system does not rely on mysql tutorials and other large database tutorials, but rely on text, because, generally, a mobile phone number, the first seven digits play a decisive role in the query system
*/
If ($ _ post)
{
$ Phone = (isset ($ _ post ["phone"])? $ _ Post ["phone"]: die ("Please return ");
Echo "your query: $ phone, info:". getphone ($ phone );
Function getphone ($ phone ){
$ Dbpath = "datas /";
$ Len = strlen ($ phone );
If ($ len! = 11 ){
Return "only 11 mobile phone numbers are supported ";
}
$ Par = "[0-9]";
For ($ I = 0; $ I <$ len; $ I ++ ){
If (! Ereg ($ par, substr ($ phone, $ I, 1 ))){
Return "the mobile phone number can only be a number ";
}
}
$ Sunum = scandir ($ dbpath); // Get the supported mobile phone number prefix
Array_splice ($ sunum,); // cancel the current directory
Array_splice ($ sunum,); // remove the upper-level Directory
$ Sub = substr ($ phone,); // obtain the first three digits of the number.
If (in_array ($ sub, $ sunum )){
$ Num = substr ($ phone, 3,4 );
$ Search = file ($ dbpath. $ sub );
$ Result = str_replace ($ num. "=", "", $ search [$ num]); // process data
Return (strlen ($ result)> 1 )? $ Result: "0 ";
} Else {
Return "$ sub" is not supported Currently ";
}
}
}
?>
Mobile phone number attribution query
...