Saturday, June 23, 2007

检查客户端浏览器和操作系统PHP脚本

使用方法:

echo ( browser_detection( 'number' ) .'
'.
browser_detection( 'browser' ) .'
'.
browser_detection( 'os' ) .'
'.
browser_detection( 'os_number' ) );
?>


Outputs (browser version, browser, os, os number):

1.5
moz
nt
5.1



if ( ( browser_detection( 'browser' ) == 'ie' )
&&
( browser_detection( 'number' ) >= 5 ) )
{
echo 'it is Internet Explorer ' .
browser_detection( 'number' );
// or anything else you want to happen of course
}
?>


下载:
browser_detection_php_ar.txt

原文地址:
http://techpatterns.com/downloads/php_browser_detection.php

No comments:

Post a Comment