How To Detect And Redirect To Mobile Site Using PHP?

If you don't want to use javascript, you can handle it via php. Take a look at this lib: http://code.google.com/p/php-mobile-detect/. And then you could do something like this code:

<?php
include 'Mobile_Detect.php';
$detect = new Mobile_Detect();

if ($detect->isMobile()) {
    header('Location: yourpage.php');
    exit(0);
}

This library is reliable and usable until today. It's great. I hope you find this short-blog useful. If you want to get new posts, make sure to subscribe to Value In Brief by Email.
Comment via Facebook
0 Comment via Google

0 تعليقات:

Post a Comment