0

当我运行我的代码来检测 Ipod 和 Iphone 时,我试图添加一些代码,但我在 webb 上找不到任何信息。

$iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
$iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$iPad = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");
if(stripos($_SERVER['HTTP_USER_AGENT'],"Android") && stripos($_SERVER['HTTP_USER_AGENT'],"mobile"))
{
    $Android = true;
}
else if(stripos($_SERVER['HTTP_USER_AGENT'],"Android"))
{
    $Android = false;
    $AndroidTablet = true;
}
else
{
    $Android = false;
    $AndroidTablet = false;
}
$webOS = stripos($_SERVER['HTTP_USER_AGENT'],"webOS");
$BlackBerry = stripos($_SERVER['HTTP_USER_AGENT'],"BlackBerry");
$RimTablet= stripos($_SERVER['HTTP_USER_AGENT'],"RIM Tablet");


//do something with this information
if( $iPod || $iPhone )
{
    // What code should It be here.
}
4

0 回答 0