xampp browscap.ini is present but still get_browser() giving strange values

1.4k views Asked by At

Before saying that its a duplicate please read on, I have done my homework properly :) I have checked the other posts but nothing helped :(


Here are the things that i have already taken care of:

1. Downloaded updated copy of php_browscap.ini from http://tempdownloads.browserscap.com/ (used the 'use only with PHP' version ofcourse)

2. tried php_browscap.ini,lite_php_browscap.ini and full_php_browscap.ini 3. edited the php.ini file to

[browscap]
;http://php.net/browscap
browscap = "C:\xampp\php\extras\full_php_browscap.ini"

4. confirmed that i have changed the correct php.ini file by checking php_info()

5. and yes removed that ; from ';browscap = .....'

6. restated the xampp server

7. tried checking the any file access error using "Process Monitor" https://www.dropbox.com/s/loi8p0fkykzcndr/process_monitor.png

But still getting the strange values

Array ( [browser_name_regex] => §^.*$§ [browser_name_pattern] => * [comment] => Default Browser [browser] => Default Browser [version] => 0.0 [majorver] => 0 [minorver] => 0 [platform] => unknown [platform_version] => unknown [platform_description] => unknown [alpha] => [beta] => [win16] => [win32] => [win64] => [frames] => [iframes] => [tables] => [cookies] => [backgroundsounds] => [javascript] => [vbscript] => [javaapplets] => [activexcontrols] => [ismobiledevice] => [issyndicationreader] => [crawler] => [cssversion] => 0 [aolversion] => 0 [device_name] => unknown [device_maker] => unknown [renderingengine_name] => unknown [renderingengine_version] => unknown [renderingengine_description] => unknown ) 

Please help me, I tried a lot spending hours reading the answers posted here, tried to find a solution on google, saw videos of NewBoston

1

There are 1 answers

1
shivaP On
// Loads the class
require 'path/to/Browscap.php';
// Creates a new Browscap object (loads or creates the cache)
$bc = new Browscap('path/to/the/cache/dir');
// Gets information about the current browser's user agent
$current_browser = $bc->getBrowser();    
// Output the result
echo '<pre>'; // some formatting issues ;)
print_r($current_browser);

We are going to obviate the last section under the comment ‘Output the result’ so your code should look like this…

 // Loads the class
require 'path/to/Browscap.php';
 // Creates a new Browscap object (loads or creates the cache)
  $bc = new Browscap('path/to/the/cache/dir');
 // Gets information about the current browser's user agent
 $current_browser = $bc->getBrowser();