Created
March 27, 2018 16:23
-
-
Save koreapyj/dde38f8f5b85a19f7f7d291a32ac0d0b to your computer and use it in GitHub Desktop.
SKT 피쳐폰 User-Agent 파서
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 parseSKTUA($UAString) { | |
if(!preg_match('/^(010|011|016|017|018|019|IRM)([0-9A-F])([0-9A-F])(.{2})([0-9A-Z]{2})([0-9]{2})([0-9]{2})([0-9]{3})([0-9]{3})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{8})\s*(?:;|$)/', $UAString, $match)) { | |
return false; | |
} | |
return array_combine([ 'FULL_STRING', 'CDMA_MIN_PREFIX', 'SERVICE_TYPE', 'HANDSET_TYPE', 'VENDOR', 'VENDOR_TYPE', 'BROWSER_TYPE', 'VERSION', 'SCREEN_WIDTH', 'SCREEN_HEIGHT', 'SCREEN_COLUMN', 'SCREEN_ROW', 'COLOR_DEPTH', 'CDMA_MIN', ], $match); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment