Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to detect If user have internet explorer 8 or 9 or higher using PHP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 247
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: