问题描述
这不是working.i意味着我有很多的脚本来获得IP和OS,但无论如何get_browser是内部的功能,应该工作,但其not.when我试图让在功能上,我收到了print_r的。
it's not working.i mean i have many scripts to get ip and os but anyway get_browser is internal function and should work but its not.when i try to get a print_r on the function i get.
Array ( [browser_name_regex] => §^.*$§ [browser_name_pattern] => * [browser] => Default Browser [version] => 0 [majorver] => 0 [minorver] => 0 [platform] => unknown [alpha] => [beta] => [win16] => [win32] => [win64] => [frames] => 1 [iframes] => [tables] => 1 [cookies] => [backgroundsounds] => [cdf] => [vbscript] => [javaapplets] => [javascript] => [activexcontrols] => [isbanned] => [ismobiledevice] => [issyndicationreader] => [crawler] => [cssversion] => 0 [supportscss] => [aol] => [aolversion] => 0 )
我使用的win7和Firefox。
和我有最新的browcap并设置php.ini.without在PHP虽然idont得到一个返回的错误。
I'm using win7 and firefox.And i have the latest browcap and set in php.ini.without that php returns error while idont get one.
推荐答案
的 我已经听到很多人抱怨怎么功能只是没有在其网站上的工作。如果您在本手册来细看,你会发现下面的声明进一步下跌:的
I’ve heard many people complain about how the function just doesn’t work on their site. If you take a careful look at the manual, you’ll notice the following notice further down:
-
您需要做的第一件事是检查,如果你的系统已经安装的Browscap.ini,如果没有,你可以自己做。调用的phpinfo()函数。这将帮助你收集有关你的系统的一些信息:
The first thing you need to do is to check if your system has browscap.ini installed and if not, can you do so by yourself. invoke the phpinfo() function. This will help you gather some information about your system:
如果没有安装browscap,然后寻找配置文件(php.ini中)路径。这是你的PHP配置文件位于和settings.After大功告成启用browscap,它应该是这个样子:
If browscap is not installed, then look for Configuration File (php.ini) Path. This is where your PHP configuration file is located and enable browscap settings.After you’re done, it should look something like this:
[browscap]
[browscap]
browscap =D:\\ XAMPP \\ PHP \\演员\\的browscap.ini
browscap = "D:\xampp\php\extras\browscap.ini"
重新启动你的apache试试下面code
Restart your apache try the below code
$浏览器= get_browser(NULL,TRUE);
$browser = get_browser(null, true);
的print_r($浏览器);
print_r($browser);
如果您仍然get_browser()是不是与你的Browscap.ini文件正确运行可能存在的问题。您可以从更新Browscap.ini文件,并替换您的browscap.ini将位于/php/extras/browscap.ini
if still your get_browser() is not functioning proper there might be problem with your browscap.ini file. You can download the updated browscap.ini file from https://browsers.garykeith.com/downloads, and replace your browscap.ini will be located in /php/extras/browscap.ini
一旦你做了,再次重新启动Apache和执行code。
Once you done, restart your apache again and execute the code.
这篇关于get_browser不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!