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)

Advertisements

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


Archive

October 2018
M T W T F S S
« Feb    
1234567
891011121314
15161718192021
22232425262728
293031  

Recent Posts