How do you get the Browser information?
Answers were Sorted based on User's Feedback
Answer / jahanvi
get_browser() attempts to determine the capabilities of the
user's browser. This is done by looking up the browser's
information in the browscap.ini file.
echo $_SERVER['HTTP_USER_AGENT'] . "<hr />\n";
$browser = get_browser();
foreach ($browser as $name => $value) {
echo "<b>$name</b> $value <br />\n";
}
| Is This Answer Correct ? | 8 Yes | 3 No |
Answer / ravi rajendra k
If you need a parser for getting OS, browser name and version details, use this pattern in a preg_match_all function.
$pattern = '#(?<browser>' . join('|', $known) .')[/ ]+(?<version>[0-9]+(?:\.[0-9]+)?)#i';
You can see my article www.peacemax.com/11/php/user-agents-php-snippet where i wrote the entire function for getting those details.
| Is This Answer Correct ? | 1 Yes | 0 No |
What is PHP? Who is the father or inventor of PHP?
How to remove values saved in the current session?
Does php use html?
What is the difference between get and post in php?
What is the difference between nowdoc and heredoc?
Tell me how can we check the value of a given variable is alphanumeric?
How do you identify independent and dependent variables in regression analysis?
What are the different tables present in mysql, which type of table is generated when we are creating a table in the following syntax: create table employee(eno int(2),ename varchar(10)) ?
what is the scope of php in the future if any other language is developed then may be php is loss ???
how many type of url?
How can you access a COM object from a PHP page?
How can we get the properties (size, type, width, height) of an image using PHP image functions?