douyi6755 2017-06-09 12:07
浏览 20
已采纳

如何检查用户的平台symfony / PHP

I would like to know how to check if a user is connecting from a computer, or from a Phone. I'm using Symfony(Latest) and of course PhpPoo. I tried to use PHP_OS, but there is too much choice, and "home-made function" are not optimized.

The fact is that if the user is conneting to my website from a computer, i won't be able to access to it, but if it's from a mobile phone, i will be able.

Thanks :)

  • 写回答

1条回答 默认 最新

  • douji1999 2017-06-10 08:48
    关注

    I usually use the MobileDetect library for detecting the device and supported features of the client.

    There is a convenient Symfony integration: MobileDetectBundle

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 chaquopy python 安卓
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题