Skip to main content

Posts

Showing posts with the label device detect

Detecting the browsing device

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 }