$agent = $_SERVER['HTTP_USER_AGENT']; if(ereg("^DoCoMo", $agent)){ header("Location: ./i/index.php"); exit; }else if(ereg("^J-PHONE|^Vodafone|^SoftBank", $agent)){ header("Location: ./i/index.php"); exit; }else if(ereg("^UP.Browser|^KDDI", $agent)){ header("Location: ./i/index.php"); exit; } if(strstr($agent,"iPhone")){ header("Location: ./sp/index.php"); exit(); } if(strstr($agent,"Android")){ header("Location: ./sp/index.php"); exit(); } ?>