Created
December 10, 2010 20:25
-
-
Save meancode/736755 to your computer and use it in GitHub Desktop.
Serve correct apple-touch-startup-image
This file contains 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 | |
function is_android(){ | |
return strstr($_SERVER['HTTP_USER_AGENT'], 'Android'); | |
} | |
function is_ipad(){ | |
return strstr($_SERVER['HTTP_USER_AGENT'], 'iPad'); | |
} | |
if (is_android()){ | |
//Android 1.x User | |
echo ' <link rel="apple-touch-icon-precomposed" href="<$mt:BlogURL$>apple-touch-icon-precomposed.png"/>'; | |
} | |
elseif (is_ipad()){ | |
//iPad User | |
echo ' <link rel="apple-touch-startup-image" href="/apple-touch-startup-image-ipad.png">'; | |
} | |
else { | |
//Everyone Else | |
echo ' <link rel="apple-touch-startup-image" href="/apple-touch-startup-image.png">'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment