<?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("&", "&",$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 ();?>