B
B
banny_name2015-10-15 19:58:26
PHP
banny_name, 2015-10-15 19:58:26

How to correctly determine the user's browser?

$_SERVER['HTTP_USER_AGENT'] - Gives a string of all browsers:

string(134) "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 YaBrowser/15.9.2403.3043 Safari/537.36"

get_browser(); - requires server side settings and fresh browscap.ini

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Aksentiev, 2015-10-15
@Sanasol

https://github.com/donatj/PhpUserAgent

A
Andrew, 2015-10-15
@Ashlst

Watch the User-Agent header.
But this is not a 100% way. easy to change.

K
Konstantin, 2015-10-15
@unity_ultra_hardcore

However, get_browser is the best way to get the most relevant and user friendly information.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question