Click here to Skip to main content
15,909,193 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I was wondering how to detect browser capabilities like Facebook redirects user to - touch.facebook.com or mbasic.facebook.com according to their browser capability even if they come from the same android device.

What I have tried:

Googling but didn't find what I need.
Posted
Updated 29-Jul-16 17:18pm
v6

1 solution

Using PHP.net as a resource:

PHP
mixed get_browser ([ string $user_agent [, bool $return_array = false ]] )


"Attempts to determine the capabilities of the user's browser, by looking up the browser's information in the browscap.ini file."

This outputs something similar to:

"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3"

You can use this to send users to different versions of your site depending on the result.

If you need any additional help or clarification, or this answer didn't help, comment and I'll try and help more!

PHP: get_browser - Manual[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900