본문 바로가기

Story/php

detect-mobile-devices 모바일 체크

반응형
<?php
// 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() ){
   
}
?>

 

출처

http://www.bitrepository.com/detect-mobile-devices-on-front-end-and-back-end.html

http://mobiledetect.net/

반응형