Follow Our FB Page << >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

How do you get the Browser information?

Answers were Sorted based on User's Feedback

How do you get the Browser information?..

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

How do you get the Browser information?..

Answer / ram


Is This Answer Correct ?    3 Yes 0 No

How do you get the Browser information?..

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 where i wrote the entire function for getting those details.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More PHP Interview Questions

What is php compared to html?

0 Answers  

Tell me what should we do to be able to export data into an excel file?

0 Answers  

What is a procedure in php?

5 Answers   Wipro,

Tell me what is the actually used php version?

0 Answers  

How to set cookies?

0 Answers  

What is preg_match?

0 Answers  

Explain me what are the differences between mysql_fetch_array(), mysql_fetch_object(), mysql_fetch_row()?

0 Answers  

What are the differences between PHP3 and PHP4 versions?

1 Answers  

what is pear in php in brief ?

1 Answers  

Which is a perfect example of runtime polymorphism?

0 Answers  

How to get tabels from database in php andd display it in the table form using codelgniter? plz help me

2 Answers  

What is the function to count elements in an array in PHP?

0 Answers