Detect Mobile Safari with PHP

It’s really easy to detect mobile Safari with PHP:

$isMobileSafari = preg_match('/(iPod|iPhone|iPad)/', $_SERVER['HTTP_USER_AGENT']);

The variable is TRUE is it’s mobile Safari on an iPod, iPhone or iPad, FALSE otherwise.

 


About Joseph R. B. Taylor

is a designer/developer who makes stuff for screens of all shapes and sizes. He currently works at Edvisors, Inc. where he creates screen-based experiences for used by millions of college students every year.

Wanna Talk?

Contact Me