By 酷飞软件
Use Composer to install the library.
$ composer require kufeisoft/ua - 获取用户操作系统信息
$serverName = \kufeisoft\Ua::getOS($ua = "");
print_r($serverName);
// 返回的值是一个数组
// 返回结果:
// ['server' => '操作系统', 'version' => '版本号'] $ua = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36', ;
$serverInfo = \kufeisoft\Ua::getOS($ua);
print_r($serverInfo);
// 输出结果
// ['server' => 'Mac OS X', 'version' => '10.15.7']通过用户传入的useragent串来返回用户操作系统类型及版本号
想好了再写
This bundle is under the MIT license. For the full copyright and license information please view the LICENSE file that was distributed with this source code.