답변 1개
그누보드에서 사용되는 소스를 이용하면..
</span> </p><p style="font-size: 14.6667px;">define('G5_MOBILE_AGENT', 'phone|samsung|lgtel|mobile|[^A]skt|nokia|blackberry|android|sony');
</p><p style="font-size: 14.6667px;">
</p><p style="font-size: 14.6667px;">function is_mobile() <span style="font-size: 14.6667px;">{</span></p><p style="font-size: 14.6667px;"> return preg_match('/'.G5_MOBILE_AGENT.'/i', $_SERVER['HTTP_USER_AGENT']);</p><p style="font-size: 14.6667px;">}</p><p style="font-size: 14.6667px;">
</p><p style="font-size: 14.6667px;">if (is_mobile()) {</p><p style="font-size: 14.6667px;"> //모바일 처리</p><p style="font-size: 14.6667px;">} else {</p><p style="font-size: 14.6667px;"> // 비 모바일 처리</p><p style="font-size: 14.6667px;">}</p><p style="font-size: 14.6667px;">
is_mobile() 함수로 체크가 가능합니다.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인