작성일 : 16-01-08 17:03
|
[PHP] 익스플로러8 체크 PHP
|
|
|
글쓴이 :
조형래
 조회 : 3,167
|
<?php
preg_match('/MSIE (.*?);/', $_SERVER['HTTP_USER_AGENT'], $matches);
if(count($matches)<2){
preg_match('/Trident\/\d{1,2}.\d{1,2}; rv:([0-9]*)/', $_SERVER['HTTP_USER_AGENT'], $matches);
}
if (count($matches)>1){ $version = $matches[1];//$matches변수값이 있으면 IE브라우저
if($version<=8){
?>
<!--if IE<=8 --under ie8 (including ie7, ie8)-->
<link rel="stylesheet" href="css/style_ie8.css" type="text/css"/>
<?php
}else{
?>
<!--if IE>8 upper ie8 (ie9, ie10, ie11)-->
<link rel="stylesheet" href="css/style.css" type="text/css"/>
<link rel="stylesheet" href="css/res.css" type="text/css"/>
<link rel="stylesheet" href="css/bootstrap.css" type="text/css"/ media="screen">
<?php
}
}else{
?>
<!-- if it is not IE-->
<link rel="stylesheet" href="css/style.css" type="text/css"/>
<link rel="stylesheet" href="css/res.css" type="text/css"/>
<link rel="stylesheet" href="css/bootstrap.css" type="text/css"/ media="screen">
<?php
}
?>
|
|