User agent, extract OS and browser from string

前端 未结 3 1763
难免孤独
难免孤独 2021-01-13 09:48

I\'d like to extract full the OS name and browser from the user agent string. How can I do this?

3条回答
  •  不思量自难忘°
    2021-01-13 10:11

    @augustknight: Note, the IE11 doesn´t send a "MSIE" token, i would suggest to add a match to a Trident token.

    IE 11 user agent sample:

    Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko
    

    change code:

    ?>

提交回复
热议问题