Snippets

iPhone CSS Detector

iPhone Detector is great as it allows you to style for the iPhone device and standard web browsers.
Simply add your iPhone stylesheet to the ‘iphone.css’ location and add your default stylesheet to the ‘default.css’
Good Luck & Enjoy.

<?php
  $browser = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
  if ($browser == true){$browser = 'iphone';}
?>
			
<?php if($browser == 'iphone'){ ?>
  <link rel="stylesheet" href="css/iphone.css" />
<?php } else{ ?>
  <link rel="stylesheet" href="css/default.css" />
<?php } ?>

Source: http://www.media21a.co.uk/themes/infinite-tumblr-gallery/...

Share this snippet