$ua=$_SERVER['HTTP_USER_AGENT']; function isIE(){ global $ua; if(strstr($ua,"MSIE")||strstr($ua,"Trident")){ return true; }else{ return false; } } $smartphone = false; if((strpos($ua,'iPhone')!==false)||(strpos($ua,'iPod')!==false)||(strpos($ua,'iPad')!==false)||(strpos($ua,'Android')!==false)){ $smartphone = true; } ?>