Codesnipp.it Social Code Sharing

Amber Weinberg

Discerning Between iPhone & iPad With PHP

by Amber Weinberg on Dec 28, 2011

<?php if(strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'],'iPod')) { ?> <meta name="viewport" content="width=device-width; initial-scale=.28; maximum-scale=1.0;"> <?php } else if(strstr($_SERVER['HTTP_USER_AGENT'],'iPad')) { ?> <meta name="viewport" content="width=device-width; initial-scale=.66; maximum-scale=1.0;"> <?php } ?>

Can't see the comments? Please login first :)