PHP

모바일 기기 체크

ssNi 2014. 8. 21. 14:06


$mobile_agent = array("ipone","ipod","android","blackberry","opera Mini", "windows ce", "nokia", "sony" );

$check_mobile = false;

for($i=0; $i<sizeof($mobile_agent); $i++){ 

if(preg_match("/$mobile_agent[$i]/", strtolower($_SERVER['HTTP_USER_AGENT']))){ 

$check_mobile = true;

break; 

}


if($check_mobile)

//echo"모바일 접속";

}

else 

{

//echo "PC로 접속";

}

'PHP' 카테고리의 다른 글

비밀번호 암호화  (0) 2014.11.26
strtr 함수  (0) 2014.08.21
코드이그나이터 세그먼트  (0) 2014.08.20
코드이그나이터 소개  (0) 2014.08.19
코드이그나이터 게시판  (0) 2014.08.19