I am using this preg_match
string
preg_match(\'/Trident/7.0; rv:11.0/\',$_SERVER[\"HTTP_USER_AGENT\"]
to detect IE11 so I can
It's always good to use another character which is not in regexp string so you don't have to escape your string and easier to read for long ones. So you may use ~
for delimiter:
preg_match('~Trident/7.0; rv:11.0~',$_SERVER["HTTP_USER_AGENT"])
Another idea is to use stristr function to see if a string occurs in another one
stristr($_SERVER['HTTP_USER_AGENT'],'Trident/7.0; rv:11.0')