Simplest way to detect a mobile device in PHP

后端 未结 15 2615
别跟我提以往
别跟我提以往 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:25

    You only need to include user_agent.php file which can be found from Mobile device detection in PHP page and use the following code.

    is_mobile()){
       header("Location:http://m.codexworld.com");
       exit;
    }
    ?>
    

提交回复
热议问题