Created
June 22, 2014 10:53
-
-
Save tjhole/95c32ff24a1ef59a8ff5 to your computer and use it in GitHub Desktop.
PHP: If Mobile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isMobile() { | |
return preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment