Skip to content

Instantly share code, notes, and snippets.

@meancode
Created December 10, 2010 20:25
Show Gist options
  • Save meancode/736755 to your computer and use it in GitHub Desktop.
Save meancode/736755 to your computer and use it in GitHub Desktop.
Serve correct apple-touch-startup-image
<?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