Created
October 31, 2013 07:20
-
-
Save yujuwon/7245490 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function _checkMobile(){ | |
| $result = false; | |
| $mobile = '/(iPhone|Android)/'; | |
| if(preg_match($mobile, $_SERVER['HTTP_USER_AGENT'])){ | |
| $result = true; // 현재 모바일에서 들어온 HTTP 요청임. | |
| } | |
| return $result; | |
| } | |
| if(_checkMobile() == true){ | |
| echo "모바일 접속 입니다."; | |
| }else{ | |
| echo "PC 접속 입니다."; | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment