Simplest way to detect a mobile device in PHP

后端 未结 15 2516
别跟我提以往
别跟我提以往 2020-11-22 05:12

What is the simplest way to tell if a user is using a mobile device to browse my site using PHP?

I have come across many classes that you can use but I was hoping fo

15条回答
  •  遇见更好的自我
    2020-11-22 05:34

    There is no reliable way. You can perhaps look at the user-agent string, but this can be spoofed, or omitted. Alternatively, you could use a GeoIP service to lookup the client's IP address, but again, this can be easily circumvented.

提交回复
热议问题