Last active
April 28, 2016 08:36
-
-
Save elizov/288549b53e1f41f7f3ca447b12ce694f to your computer and use it in GitHub Desktop.
Определить iOS/Android
This file contains 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 getDevice(){ | |
$device = []; | |
if(preg_match('/(iPhone|iPod|iPad|Android)/', $_SERVER['HTTP_USER_AGENT'], $device)){ | |
return $device[0]; | |
} | |
return ''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment