Code: Select all
case (preg_match('/android/i',$user_agent));
if (preg_match('/SM-G870A/i',$user_agent))
{
$status = 'Samsung Galaxy S5 Active';
}
elseif (preg_match('/SGH-I497/i',$user_agent))
{
$status = 'Samsung Galaxy2 Tablet';
}
elseif (preg_match('/GT-I9505|GT-I9500/i',$user_agent))
{
$status = 'Samsung Galaxy S4';
}
elseif (preg_match('/TF101/i',$user_agent))
{
$status = 'Asus Transformer Tablet';
}
elseif (preg_match('/Archos 40b/i',$user_agent))
{
$status = 'Archos 40b Titanium Surround';
}
elseif (preg_match('/A0001/i',$user_agent))
{
$status = 'OnePlus One';
}
elseif (preg_match('/Nexus 4/i',$user_agent))
{
$status = 'LG Nexus 4';
}
else
{
$status = 'Android';
}
$mobile_browser = $android;
if(substr($android,0,4)=='http')
{
$mobileredirect = $android;
}
break;
Code: Select all
case (preg_match('/blackberry/i',$user_agent));
if (preg_match('/BlackBerry9900|BlackBerry9930|BlackBerry9790|BlackBerry9780|BlackBerry9700|BlackBerry9650|BlackBerry9000|/i',$user_agent))
{
$status = 'BlackBerry Bold';
}
elseif (preg_match('/BlackBerry9380|BlackBerry9370|BlackBerry9360|BlackBerry9350|BlackBerry9330|BlackBerry9320|BlackBerry9300|BlackBerry9220|BlackBerry8980|BlackBerry8900|BlackBerry8530|BlackBerry8520|BlackBerry8330|BlackBerry8320|BlackBerry8310|BlackBerry8300/i',$user_agent))
{
$status = 'BlackBerry Curve';
}
elseif (preg_match('/BlackBerry9860|BlackBerry9850|BlackBerry9810|BlackBerry9800/i',$user_agent))
{
$status = 'BlackBerry Torch';
}
elseif (preg_match('/BlackBerry9900/i',$user_agent))
{
$status = 'BlackBerry Touch';
}
elseif (preg_match('/BlackBerry9105/i',$user_agent))
{
$status = 'BlackBerry Pearl';
}
elseif (preg_match('/BlackBerry8220/i',$user_agent))
{
$status = 'BlackBerry Pearl Flip';
}
elseif (preg_match('/BlackBerry Storm|BlackBerry Storm2/i',$user_agent))
{
$status = 'BlackBerry Storm';
}
elseif (preg_match('/BlackBerry Passport/i',$user_agent))
{
$status = 'BlackBerry Passport';
}
elseif (preg_match('/BlackBerry Porsche/i',$user_agent))
{
$status = 'BlackBerry Porsche';
}
elseif (preg_match('/BlackBerry PlayBook/i',$user_agent))
{
$status = 'BlackBerry PlayBook';
}
else
{
$status = 'BlackBerry';
}
$mobile_browser = $blackberry;
if(substr($blackberry,0,4)=='http')
{
$mobileredirect = $blackberry;
}
break;