/**<br>
* 获取客户端浏览器类型<br>
* @param string $glue 浏览器类型和版本号之间的连接符<br>
* @return string|array 传递连接符则连接浏览器类型和版本号返回字符串否则直接返回数组 false为未知浏览器类型<br>
*/<br>
function get_client_browser($glue = null) {<br>
$browser = array();<br>
$agent = $_SERVER['HTTP_USER_AGENT']; //获取客户端信息<br>
<br>
/* 定义浏览器特性正则表达式 */<br>
$regex = array(<br>
'ie' => '/(MSIE) (\d+\.\d)/',<br>
'chrome' => '/(Chrome)\/(\d+\.\d+)/',<br>
'firefox' => '/(Firefox)\/(\d+\.\d+)/',<br>
'opera' => '/(Opera)\/(\d+\.\d+)/',<br>
'safari' => '/Version\/(\d+\.\d+\.\d) (Safari)/',<br>
);<br>
<br>
foreach($regex as $type => $reg) {<br>
preg_match($reg, $agent, $data);<br>
if(!empty($data) && is_array($data)){<br>
$browser = $type === 'safari' ? array($data[2], $data[1]) : array($data[1], $data[2]);<br>
break;<br>
}<br>
}<br>
<br>
return empty($browser) ? false : (is_null($glue) ? $browser : implode($glue, $browser));<br>
}
AD:真正免费,域名+虚机+企业邮箱=0元

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

Dreamweaver Mac version
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software