How to get user agent in PHP

前端 未结 3 1596
南笙
南笙 2020-12-01 10:25

I\'m using this JS code to know what browser is user using for.


And I

相关标签:
3条回答
  • 2020-12-01 10:33

    You can use the jQuery ajax method link if you want to pass data from client to server. In this case you can use $_SERVER['HTTP_USER_AGENT'] variable to found browser user agent.

    0 讨论(0)
  • 2020-12-01 10:37

    Use the native PHP $_SERVER['HTTP_USER_AGENT'] variable instead.

    0 讨论(0)
  • 2020-12-01 10:48

    You could also use the php native funcion get_browser()

    IMPORTANT NOTE: You should have a browscap.ini file.

    0 讨论(0)
提交回复
热议问题