I am trying to do the following with PHP:
$user_agent = "Mozilla/5.0 (Linux; Android 4.4.2; SAMSUNG-GT-I9505 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36" if (preg_match('/android/i', $user_agent)) { $version = preg_split('Android (.*?);', $user_agent);
But I really don’t know how to get the code correctly, and the part after the $ version is a hunch. can anyone help me? Maybe with preg_split? I want 4.4.2 to be stored in $ version.
php regex
MOTIVECODEX Apr 11 '15 at 22:51 2015-04-11 22:51
source share