$ua = strtolower($_SERVER['HTTP_USER_AGENT']); if(strstr($ua,'ipad')){ header("location:./ipad/"); die(); } if(strstr($ua,'iphone') || strstr($ua,'android') || strstr($ua,'windows phone')){ header("location:./mobile/"); die(); } ?>