On developing the customer user based web server, developer should choose all supported version of web browser and code according to web browser. If you are looking for detecting the version of all IE using PHP then the code below will help you perfectly:-
preg_match('/MSIE (.*?);/', $_SERVER['HTTP_USER_AGENT'], $findversion);
if(count($findversion)<2){
preg_match('/Trident\/\d{1,2}.\d{1,2}; rv:([0-9]*)/', $_SERVER['HTTP_USER_AGENT'], $findversion);
}
if (count($findversion)>1){
//On this you have have user with IE
$version = $findversion[1];
switch(true){
case ($version<=8):
//User IE is < 8
break;
case ($version==9 || $version==10):
//User IE have 9 or 10
break;
case ($version==11):
// //User IE is of version 11
break;
}
}
0 Comment(s)