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 :)

图片转代码服务由CSDN问答提供 功能建议

我想知道如何检查用户是从计算机还是从手机连接。 我正在使用Symfony(最新),当然还有PhpPoo。 我尝试使用PHP_OS,但选择太多,“自制功能”没有优化。

事实是,如果用户从计算机连接到我的网站 ,我将无法访问它,但如果它来自手机,我将能够。

谢谢:)

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

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

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题