Posts tagged ‘mobile’

Mobile Browser Detection in PHP with RegEx

In October of last year, two thousand eight A.D., I stumbled upon a nice mobile browser detection script. Inspired by the comments, I modified the script to detect iPhones. I also made simple example scripts for two different ways of serving different content for different browsers, separate stylesheets or subdomains.

Today I received an e-mail requesting this modified script which had been removed from the file-sharing site, so I dug it up and updated it per brainhandles.com December 2008 update and and included detection of iPods, and Android devices separately from the iPhone, mobile, and desktop groups.

An without further ado, the code. (.zip 2.76kB / .tar.gz 1.76kB)

February 25, 2009 at 12:38 am Leave a comment


Archive

June 2017
M T W T F S S
« Feb    
 1234
567891011
12131415161718
19202122232425
2627282930  

Recent Posts