1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
// Include and instantiate the class. require_once 'Mobile_Detect.php'; $detect = new Mobile_Detect; // Any mobile device (phones or tablets). if ( $detect->isMobile() ) { } // Any tablet device. if( $detect->isTablet() ){ } // Exclude tablets. if( $detect->isMobile() && !$detect->isTablet() ){ } // Check for a specific platform with the help of the magic methods: if( $detect->isiOS() ){ } if( $detect->isAndroidOS() ){ } |
Leave a reply