Category Archives: php监测代码
← Continue Reading
PHP中可以通过$_SERVER['HTTP_USER_AGENT'] 获取到用户的浏览器ua值。
client.class.php
1) $matches[1] = 'Lion '.$matches[1];
elseif(count(explode(8,$matches[1]))>1) $matches[1] = 'Mountain Lion '.$matches[1];
...
← Continue Reading
php检测终端设备是平板、手机还是电脑
这段代码可以帮助你检测用户的终端设备室平板电脑,手机还是桌面电脑,分别返回"tablet","mobile","desktop"
<?php
$ua=$_SERVER['HTTP_USER_AGENT'];
function userAgent($ua){
## This credit must stay intact (Unless y...