serbanghita / Mobile-Detect

Mobile_Detect is a lightweight PHP class for detecting mobile devices (including tablets). It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.
http://mobiledetect.net
MIT License
10.55k stars 2.68k forks source link

How to get device value number #840

Closed ppon05019456 closed 3 years ago

ppon05019456 commented 4 years ago

EX: version(Chrome) | 83.0.4103.116 version(Safari) | 537.36 version(Webkit) | 537.36 version(Windows NT) | 10.0 if i want get version(Chrome)?

serbanghita commented 3 years ago
$detect = new Mobile_Detect;
$detect->setUserAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_16_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36');
var_dump($detect->version("Chrome"));
$ php -f examples/test.php
string(12) "85.0.4183.83"