我使用的get_browser()
功能,我安裝http://tempdownloads.browserscap.com/最新php_browscap.ini
文件,更新了我的的php.ini文件,以反映新的位置。PHP - get_browser()導致
這裏是我的簡單的代碼,我從PHP的網站收集:
<?php
echo $_SERVER['HTTP_USER_AGENT'];
echo "<br>";
echo "<br>";
$browser = get_browser(null, true);
print_r($browser);
?>
,結果是這樣的:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0
Array ([browser_name_regex] => �^mozilla/5\.0 \(.*windows nt 6\.1.*wow64.*\).*gecko/.*firefox/21\..*$� [browser_name_pattern] => Mozilla/5.0 (*Windows NT 6.1*WOW64*)*Gecko/*Firefox/21.* [parent] => Firefox 21.0 [platform] => Win7 [platform_version] => 6.1 [win32] => [win64] => 1 [comment] => Firefox 21.0 [browser] => Firefox [version] => 21.0 [majorver] => 21 [minorver] => 0 [beta] => 1 [frames] => 1 [iframes] => 1 [tables] => 1 [cookies] => 1 [javascript] => 1 [javaapplets] => 1 [cssversion] => 3 [alpha] => [win16] => [backgroundsounds] => [vbscript] => [activexcontrols] => [ismobiledevice] => [issyndicationreader] => [crawler] => [aolversion] => 0)
我看到在[browser_name_regex]一個奇怪的字符部分。
這是預期的嗎?
此外,我
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=612364這似乎符合您的問題。您使用的是哪個版本的PHP? –