We can check the device that is used for browsing. The following code detects if the browsing device is mobile. if (preg_match("/phone|iphone|itouch|ipod|symbian|android|htc_|htc-|palmos|blackberry|opera mini|iemobile|windows ce|nokia|fennec|hiptop|kindle|mot |mot-|webos\/|samsung|sonyericsson|^sie-|nintendo/", strtolower($_SERVER['HTTP_USER_AGENT']))) { //browsed from mobile device }
IT graduate and a professional web developer having specialization on magento, ci, opencart, wordpress