Skip to content

Instantly share code, notes, and snippets.

@mauriciopazpp
Created July 20, 2018 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mauriciopazpp/f38bdcc7afef075819bd397de06b375c to your computer and use it in GitHub Desktop.
Save mauriciopazpp/f38bdcc7afef075819bd397de06b375c to your computer and use it in GitHub Desktop.
Block internet explorer php
<?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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment