Iphone Detect with PHP
If you need to detect the iphone with PHP use the following code.
function detectiPhone($query){
$container = $_SERVER[’HTTP_USER_AGENT’];
$useragents = array (
“iPhone”,”iPod”);
$this->iphone = false;
foreach ( $useragents as $useragent ) {
if (eregi($useragent,$container)){
$this->iphone = true;
}
}
if($this->iphone){
echo (”This is a iphone or iphone touch - do something like redirect here”);
}else{
echo (”You are not on an iPhone or iPod touch”);
}
}
?>






great THANKS!