How do you get the Browser information?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does php support multiple inheritances?

531


What is the difference between static and dynamic websites?

510


How to get the http request in php?

578


Which function would you use to insert a record into a database in php?

564


How can we access the data sent through the url with the post method?

509






How many keywords are there in php?

621


What is difference between mysqli and mysql?

536


How many types of session are there?

543


Write a program to get lcm of two numbers using php?

512


Is facebook still in php?

517


Explain the difference between array_merge() and array_combine()?

537


How does firefox manage cookies?

546


How to reset/destroy a cookie?

579


How to get ip address of a server in php?

552


What is the use of mysql_real_escape_string in php?

459