<?php
$agent = "Mozilla/5.0 (iPad; CPU OS 10_3_2 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) CriOS/59.0.3071.102 Mobile/14F89 Safari/602.1";
echo 'v3.6.5 ';
preg_match('|CriOS[/ ]([0-9.]+)|', $agent, $version);
var_dump($version);
list ($majorVersion, $minorVersion) = explode('.', $version[1]);
echo 'v3.7.3 ';
preg_match('/Chrome[\/ ]([0-9.]+)|CrMo[\/ ]([0-9.]+)|CriOS[\/ ]([0-9.]+)/i', $agent, $version);
var_dump($version);
list ($majorVersion, $minorVersion) = explode('.', $version[1]);
- Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.14, 8.4.1
- v3.6.5 array(2) {
[0]=>
string(19) "CriOS/59.0.3071.102"
[1]=>
string(13) "59.0.3071.102"
}
v3.7.3 array(4) {
[0]=>
string(19) "CriOS/59.0.3071.102"
[1]=>
string(0) ""
[2]=>
string(0) ""
[3]=>
string(13) "59.0.3071.102"
}
Warning: Undefined array key 1 in /in/KVdRU on line 13
- Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
- v3.6.5 array(2) {
[0]=>
string(19) "CriOS/59.0.3071.102"
[1]=>
string(13) "59.0.3071.102"
}
v3.7.3 array(4) {
[0]=>
string(19) "CriOS/59.0.3071.102"
[1]=>
string(0) ""
[2]=>
string(0) ""
[3]=>
string(13) "59.0.3071.102"
}
Notice: Undefined offset: 1 in /in/KVdRU on line 13
- Output for 7.3.32 - 7.3.33
- v3.6.5 array(2) {
[0]=>
string(19) "CriOS/59.0.3071.102"
[1]=>
string(13) "59.0.3071.102"
}
v3.7.3 array(4) {
[0]=>
string(19) "CriOS/59.0.3071.102"
[1]=>
string(0) ""
[2]=>
string(0) ""
[3]=>
string(13) "59.0.3071.102"
}
preferences:
74.19 ms | 409 KiB | 5 Q