PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
if the client sents its USER_AGENT string with the request you can either read $_SERVER['HTTP_USER_AGENT'] or use get_browser(). The latter requires a proper browscap.ini as described at the manual page
But what's send within the USER_AGENT field is up to the client, either the value is correct, not set or something bogus.
Found the solution i was looking for, thanks volka.
PHP.Net Comments:
andysmith at post dot com wrote:
the example is great if you just want to spit out all that stuff, but i highly doubt anybody really wants to do that. To use the get_browser object in a conditional statement, do something like this:
Longer answer (from php.net);
In order for this to work, your browscap configuration setting in php.ini must point to the correct location of the browscap.ini file on your system. browscap.ini is not bundled with PHP but you may find an up-to-date browscap.ini file here. http://www.garykeith.com/browsers/downloads.asp
By default, the browscap directive is commented out.