這期內(nèi)容當中小編將會給大家?guī)碛嘘P(guān)利用PHP怎么對訪問設(shè)備信息進行獲取,文章內(nèi)容豐富且以專業(yè)的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。
get_onlineip(); } else { return $tip; } } // //根據(jù)ip獲得訪客所在地地名 function Getaddress($ip = '') { if (empty($ip)) { $ip = $this->Getip(); } $ipadd = file_get_contents("http://int.dpool.sina.com.cn/iplookup/iplookup.php?ip=" . $ip); // 根據(jù)新浪api接口獲取 if ($ipadd) { $charset = iconv("gbk", "utf-8", $ipadd); preg_match_all("/[\x{4e00}-\x{9fa5}]+/u", $charset, $ipadds); return $ipadds; // 返回一個二維數(shù)組 } else { return "addree is none"; } } //獲得本地真實IP // function get_onlineip() // { // $mip = file_get_contents("http://city.ip138.com/city0.asp"); // if ($mip) { // preg_match("/\[.*\]/", $mip, $sip); // $p = array( // "/\[/", // "/\]/" // ); // return preg_replace($p, "", $sip[0]); // } else { // return "獲取本地IP失??!"; // } // } } // $info = new get_equipment_info(); // echo json_decode($info -> GetLang()); // echo json_decode($info -> GetOs()); // echo json_decode($info -> GetBrowser()); // print_r($info -> Getaddress()); // echo $info -> Getip(); // echo $info -> get_onlineip(); // die; ?>
上述就是小編為大家分享的利用PHP怎么對訪問設(shè)備信息進行獲取了,如果剛好有類似的疑惑,不妨參照上述分析進行理解。如果想知道更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。