How PHP gets the local phone number

Source: Internet
Author: User

<?phpfunction inquiry_number_infor ($phonenumber)/** incoming mobile phone number, through the API to XML format data, further parsing the XML, and finally return the corresponding number information array. * * @param string $phonenumber * * @return array*/{$url = "Http://api.showji.com/Locating/default    . aspx?m= $phonenumber &output=xml&callback=querycallback ";    $lines _array = file ($url);     $lines _string = Implode (", $lines _array);    Echo htmlspecialchars ($lines _string);    echo "</br>";    $p = Xml_parser_create ();    Xml_parse_into_struct ($p, $lines _string, $vals, $index);    Xml_parser_free ($p);    $return _arr = Array ();         foreach ($vals as $val) {$key = $val ["tag"];             if ($key! = "Queryresponse") {$value = $val ["Value"];         $return _arr[$key] = $value;    } if ($key = = = "QueryResult" && $value = = = "False") break; } return $return _arr;} $ret = Inquiry_number_infor ("11210982674 "),//$ret = Inquiry_number_infor (" 15210982674 ");p Rint_r ($ret); 

How PHP gets the local phone number

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.