PHP code example of kufeisoft / ua
1. Go to this page and download the library: Download kufeisoft/ua library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kufeisoft / ua example snippets
$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']
php
$serverName = \kufeisoft\Ua::getOS($ua = "");
print_r($serverName);
// 返回的值是一个数组
// 返回结果:
// ['server' => '操作系统', 'version' => '版本号']