<?php
$agentStr = "Mozilla/5.0 (Linux; Android 8.0.0; STF-AL10 Build/HUAWEISTF-AL10; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044432 Mobile Safari/537.36 MMWEBID/7596 MicroMessenger/7.0.3.1400(0x27000335) Process/tools NetType/WIFI Language/zh_CN";
$strPattern = "/Mozilla\/5.0\s*\([^\(\)]*?(Windows[^\(\)]*?|Android[^\(\)]*?|iPhone);\s*([^\(\)]*?)\)/";
$arrMatches = [];
preg_match_all($strPattern, $agentStr, $arrMatches);
var_dump($arrMatches);
?>
PHP获取user-agent中的终端与手机型号
最新推荐文章于 2022-12-02 16:43:57 发布