Advertisement
Guest User

Untitled

a guest
Dec 13th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. <?
  2. function MobileCheck() {
  3. global $HTTP_USER_AGENT;
  4. $MobileArray = array("iphone","lgtelecom","skt","mobile","samsung","nokia","blackberry","android","android","sony","phone");
  5.  
  6. $checkCount = 0;
  7. for($i=0; $i<sizeof($MobileArray); $i++){
  8. if(preg_match("/$MobileArray[$i]/", strtolower($HTTP_USER_AGENT))){ $checkCount++; break; }
  9. }
  10. return ($checkCount >= 1) ? "Mobile" : "Computer";
  11. }
  12. if(MobileCheck() == "Computer"){
  13. echo "PC 에서 접속은 불가능 합니다.";
  14. return;
  15. }else if(MobileCheck() == "Mobile"){
  16. }
  17. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement