Created
May 1, 2015 01:50
-
-
Save teitei-tk/187a36cf01d50f15be1e to your computer and use it in GitHub Desktop.
detect ios version number
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 | |
$txt = 'Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12F70 Safari/600.1.4'; | |
$reg = '/iPhone OS ([0-9]+)_([0-9]+)/i'; | |
preg_match($reg, $txt, $result); | |
$str_version = $result[1] . '.' . $result[2]; //This variable should now contain : 4.0 | |
var_dump($result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment