我想使用:
public function BrowserCheck() {
static $Browser;
if(!isset($Browser)){
$Browser = get_browser($_SERVER['HTTP_USER_AGENT'],true);
}
return $Browser;
}
正如http://de3.php.net/manual/de/function.get-browser.php所建议的那样,但不知何故 var_dump($Result); 只会输出奇怪的值:
array(30) {
["browser_name_regex"]=>
string(6) "§^.*$§"
["browser_name_pattern"]=>
string(1) "*"
["browser"]=>
string(15) "Default Browser"
["version"]=>
string(1) "0"
["majorver"]=>
string(1) "0"
["minorver"]=>
string(1) "0"
["platform"]=>
string(7) "unknown"
["alpha"]=>
string(0) ""
["beta"]=>
string(0) ""
["win16"]=>
string(0) ""
["win32"]=>
string(0) ""
["win64"]=>
string(0) ""
["frames"]=>
string(1) "1"
["iframes"]=>
string(0) ""
["tables"]=>
string(1) "1"
["cookies"]=>
string(0) ""
["backgroundsounds"]=>
string(0) ""
["cdf"]=>
string(0) ""
["vbscript"]=>
string(0) ""
["javaapplets"]=>
string(0) ""
["javascript"]=>
string(0) ""
["activexcontrols"]=>
string(0) ""
["isbanned"]=>
string(0) ""
["ismobiledevice"]=>
string(0) ""
["issyndicationreader"]=>
string(0) ""
["crawler"]=>
string(0) ""
["cssversion"]=>
string(1) "0"
["supportscss"]=>
string(0) ""
["aol"]=>
string(0) ""
["aolversion"]=>
string(1) "0"
}
为什么?我正在使用 Chrome,它只给我一些“§^.*$§”作为找到的名称?这不可能是真的......这里有什么问题?