$url = $_SERVER['PHP_SELF']; $urlm = 'http://www.e-logit.com/m'.$_SERVER['PHP_SELF']; $agent = $_SERVER['HTTP_USER_AGENT']; if(preg_match("/^DoCoMo/", $agent)){ header("Location:$urlm"); }else if(preg_match("/^J-PHONE|^Vodafone|^SoftBank/", $agent)){ header("Location:$urlm"); }else if(preg_match("/^UP.Browser|^KDDI/", $agent)){ header("Location:$urlm"); } ?>