From the manuals I am running a simple code to fetch browser info using get_browser()
method.
Code in the manuals -
Code I am running(almost same/i tried by removing echo "<pre>";
but no effect) -
<?php
echo $_SERVER['HTTP_USER_AGENT'] . "\n\n";
$browser = get_browser(null, true);
echo "<pre>";
print_r($browser);
?>
This is the error/illegal characters
I am getting at browser_name_regex
-
I also tried this UTF 8 encoding for characters, but problem still persist.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test browser</title>
</head>
<body>
<?php
echo $_SERVER['HTTP_USER_AGENT'] . "\n\n";
$browser = get_browser(null, true);
echo "<pre>";
print_r($browser);
?>
</body>
</html>
Let me know what I am doing wrong and where to look for the solution?
One thing more to ask, in the same doc -
Attempts to determine the capabilities of the user's browser, by looking up the browser's information in the browscap.ini file.
Where do I find this browscap.ini
in my system I am using Windows 7
...although I am not very sure if it is related with this problem or not.