I am trying to set up browser detection. Ideally I'd like to handle it simple using pattern matching on $HTTP_USER_AGENT, so if anyone has written the if statements to handle that can I copy em?? The other option is the browscap.ini file but the one mentioned at the php site is sadly out of date. I checked the archives of the list about it and asptracker was mentioned but I haven't been able to access that site for a few days.
Thanks
The one below detects for IE.
if(strstr($HTTP_USER_AGENT,"MSIE")) { // Using Internet Explorer
} else { // Not IE 🙂
}
Hope this helps a bit. (you can parse further for version and all.)
-m.
The one below detects for IE. if(strstr($HTTP_USER_AGENT,"MSIE")) { // Using Internet Explorer } else { // Not IE 🙂 }
But this also suggests that Opera is IE, how do you find IE and filter the rest?
Actually, it suggests that Opera is not IE. (Unless Opera shows MSIE in UserAgent)
You can always see what User_Agent is displayed for the various browsers and set your parsing accordingly.