David Walsh recently published a blog post detailing how to detect iPhone and iPod Touch users on your website via the user agent string, and while the concept is fine, I much prefer a slightly different method using regex to do the detection. In PHP: if(preg_match(‘/Apple.*Mobile.*Safari/’, $_SERVER[‘HTTP_USER_AGENT’]) { header(‘Location: http://yoursite.com/iphone’); [...]
Archive | February, 2009
More Posts