

$userUA = $_SERVER['HTTP_USER_AGENT']; $uas = array('Android', 'iPod', 'iPhone', 'Mini'); $isMobile = 0; foreach ($uas as &$ua) { if (substr_count($userUA, $ua) > 0) { $isMobile = true; break; } } if ($isMobile == 1) { header("Location: /mobile/index.php"); } ?>