WAP website Get visitor phone number PHP class file

Source: Internet
Author: User

<?PHP/** * Class Name: mobile* Description: Mobile Information class * Other:*/classmobile{/** * Function Name: getphonenumber* function function: Take phone number * input parameter: none* function return value: Successful return number, failed to return false* other instructions: Description*/functionGetphonenumber () {if(isset($_server[' Http_x_network_info ']))       {         $str 1=$_server[' Http_x_network_info ']; $getstr 1=Preg_replace('/(. *,) (13[\d]{9}) (,. *)/I ', ' \\2 ',$str 1); Return $getstr 1; }       ElseIf(isset($_server[' http_x_up_calling_line_id ']))       {         $getstr 2=$_server[' http_x_up_calling_line_id ']; Return $getstr 2; }       ElseIf(isset($_server[' Http_x_up_subno ']))       {         $STR 3=$_server[' Http_x_up_subno ']; $GETSTR 3=Preg_replace('/(. *) (13[\d]{9}) (. *)/I ', ' \\2 ',$STR 3); Return $GETSTR 3; }       ElseIf(isset($_server[' DEVICEID ']))       {         Return $_server[' DEVICEID ']; }       Else       {         Return false; }}/** * Function Name: gethttpheader* function Function: header information * Input parameters: none* function return value: Successful return number, failed to return false* other instructions: Description*/functionGethttpheader () {$str= ' '; foreach($_server  as $key=$val)       {         $gstr=Str_replace("&", "&amp;",$val); $str.= "$key".$gstr." \ r \ n "; }       Return $str;}/** * Function Name: getua* function function: Take ua* input parameter: none* function return value: Return number successfully, failure return false* Additional instructions: Description*/functionGetua () {if(isset($_server[' Http_user_agent ']))       {         Return $_server[' Http_user_agent ']; }       Else       {         Return false; }}/** * Function Name: getphonetype* function: Get phone type * input parameter: none* function return Value: String returned successfully, failure returned false* additional instructions: Description*/functionGetphonetype () {$ua=$this-Getua (); if($ua!=false)       {         $str=Explode(‘ ‘,$ua); Return $str[0]; }       Else       {         Return false; }}/** * Function Name: isopera* function: Determine if opera* input parameter: none* function return Value: String returned successfully, failure returned false* additional instructions: Description*/functionIsopera () {$uainfo=$this-Getua (); if(Preg_match('/.*opera.*/i ',$uainfo))       {         Return true; }       Else       {         Return false; }}/** * Function Name: ism3gate* function: Determine if m3gate* input parameter: none* function return Value: String returned successfully, failure returned false* additional instructions: Description*/functionism3gate () {$uainfo=$this-Getua (); if(Preg_match('/m3gate/i ',$uainfo))       {         Return true; }       Else       {         Return false; }}/** * Function Name: gethttpaccept* function function: Get ha* input parameter: none* function return Value: String returned successfully, failure returned false* additional instructions: Description*/functiongethttpaccept () {if(isset($_server[' Http_accept ']))       {         Return $_server[' Http_accept ']; }       Else       {         Return false; }}/** * Function Name: getip* function: Get phone ip* input parameter: none* function return value: Successful return string* additional instructions: Description*/functionGetIP () {$ip=getenv(' REMOTE_ADDR '); $ip _=getenv(' Http_x_forwarded_for '); if(($ip _! = "") && ($ip _! = "Unknown"))       {         $ip=$ip _; }       return $ip;}}$ioopdnuber=NewMobile ();Echo $ioopdnuber-Getphonenumber ();?>

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.