Auto detect mobile browser (via user-agent?)

TeddyTom picture TeddyTom · Jun 17, 2009 · Viewed 302.2k times · Source

How can I detect if a user is viewing my web site from a mobile web browser so that I can then auto detect and display the appropriate version of my web site?

Answer

Chad Smith picture Chad Smith · Oct 8, 2009

There are open source scripts on Detect Mobile Browser that do this in Apache, ASP, ColdFusion, JavaScript and PHP.