A mai szösszenetünk egy nagyon apró ám sok esekben nagyon sokat segíthet ha iPhone/iPod-ra fejlesztünk. A kód rövidsége miatt a PHP-s és JavaScript-es scriptet is.
JavaScript kód
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
PHP kód
if (document.cookie.indexOf("iphone_redirect=false") == -1) window.location = "http://weboldalad.hu/iphone";
}
if(strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'],'iPod'))
{
header('Location: http://yoursite.com/iphone');
exit();
}