PHP discovers Internet Explorer which is lower than version 10

Can anyone do this for me? Since I only have poppies and I can not check IE.

What a good way to fire an event if the browser is Internet Explorer and the version is less than 10. Say it is IE 7, it will show an error, or if it is IE 9.9 it will show an error, however if it is IE 10, 10.1, 10.0.1 etc., it will not show an error.

+4
source share
3 answers

The get_browser () function can be used to detect a function.

If you really want to know the version of the user's browser, you can look at $ _ SERVER ['HTTP_USER_AGENT'] .

Warning: although most users do not, you can send another line of the user agent to the server that can be executed, for example, to protect privacy. If someone wants to go to send you a user agent to be able to use your site, although they will probably know how to deal with any errors that may occur.

As a side question, why are you trying to limit your audience to IE 10 and above? Why not use a library like Modernizr to populate features that might not be available in IE 9?

EDIT: Some IE 10 user agent string information . You will want to read this so that you know what needs to be matched against your $ _SERVER ['HTTP_USER_AGENT'] against

+2
source

Source: https://habr.com/ru/post/1397321/


All Articles