How to Use userAgent to detect mobile device

前端 未结 7 2058
独厮守ぢ
独厮守ぢ 2020-12-03 15:18

Can anyone help me with this.

I would like to detect device such as Iphone, BB, andriod and browser to apply their specific css to make it liquefied or adjust to th

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-03 15:59

    Try to use http://www.php.net/get_browser and check for isMobileDevice field. It might help only, of course, if the path to browscap.ini is set up in php.ini. If not, you can use php classes like https://github.com/garetjax/phpbrowscap

提交回复
热议问题