Pues segun lo que pone en este
enlace:
iPod:
Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A101a Safari/419.3
iPhone:
Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3
iPad:
Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) version/4.0.4 Mobile/7B367 Safari/531.21.10
Por lo que esto deberia funcionar:
function iPhoneCheck() {
$browser = strpos($_SERVER['HTTP_USER_AGENT'], "iPhone" ) || strpos($_SERVER['HTTP_USER_AGENT'], "iPod" ) || strpos($_SERVER['HTTP_USER_AGENT'], "iPad" );
if ($browser === false) {
return false;
} else {
return true;
}
}
if (iPhoneCheck()) {
} else {
header ("Location: http://www.loquesea.com"); }
?>
Y sino:
function iPhoneCheck() {
$browser = strpos($_SERVER['HTTP_USER_AGENT'], "iPhone" ) || strpos($_SERVER['HTTP_USER_AGENT'], "iPod" ) || strpos($_SERVER['HTTP_USER_AGENT'], "iPad" );
if ($browser > 0) {
return true;
} else {
return false;
}
}
if (iPhoneCheck()) {
} else {
header ("Location: http://www.loquesea.com"); }
?>