Created
June 10, 2010 16:06
-
-
Save gavinblair/433213 to your computer and use it in GitHub Desktop.
Load a mobile theme if the user is using a smartphone
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
<?php | |
if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "iphone") !== FALSE | |
|| strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "ipod") !== FALSE | |
|| strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "android") !== FALSE | |
|| strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "blackberry") !== FALSE ) { | |
include 'mobile.php'; | |
} else { | |
?><!DOCTYPE ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fork me if you have a better way to do this :)