PHP get_browser() 函数
定义和用法
get_browser() 函数返回用户浏览器的性能。
该函数通过查阅用户的 browscap.ini 文件,来测定用户浏览器的性能。
若成功,则该函数返回包含用户浏览器信息的一个对象或一个数组,若失败,则返回 false。
ภาษา
get_browser(user_agent,return_array)
ตัวแปร | รายละเอียด |
---|---|
user_agent |
เลือกตั้ง คุณสามารถปรับแต่งค่า NULL โดยผ่านปรากฎการณ์นี้ |
return_array | เลือกตั้ง |
คำแนะนำและหมายเหตุ
หมายเหตุ:คำสั่งการกลับคืนจะหยุดการคำนวณของข้อความทันที
หมายเหตุ:ฟังก์ชันนี้มีประโยชน์มากในการเก็บความจำแหล่งรหัสสำหรับการคำนวณในอนาคตในฟิลด์ของข้อมูลฐานข้อมูล
ตัวอย่าง
<?php
echo $_SERVER['HTTP_USER_AGENT'] . "<br /><br />";
$browser = get_browser(null,true)
;
print_r($browser);
?>
ออกเสียง:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) Array ( [browser_name_regex] => ^mozilla/.\.0 (compatible; msie 6\.0.*;.*windows nt 5\.1.*\.net clr.*).*$ [browser_name_pattern] => Mozilla/?.0 (compatible; MSIE 6.0*;*Windows NT 5.1*.NET CLR*)* [parent] => IE 6.0 [platform] => WinXP [netclr] => 1 [browser] => IE [version] => 6.0 [majorver] => 6 [minorver] => 0 [css] => 2 [frames] => 1 [iframes] => 1 [tables] => 1 [cookies] => 1 [backgroundsounds] => 1 [vbscript] => 1 [javascript] => 1 [javaapplets] => 1 [activexcontrols] => 1 [cdf] => 1 [aol] => [beta] => [win16] => [crawler] => [stripper] => [wap] => [ak] => [sk] => )