PHP get_browser()ฟังก์ชั่น
ตัวอย่าง
ค้นหาไฟล์ browscap.ini และคืนค่าความสามารถของเบราว์เซอร์:
<?php
echo $_SERVER['HTTP_USER_AGENT'];
$browser = get_browser();
print_r($browser);
?>
ความหมายและการใช้งาน
ฟังก์ชัน get_browser() จะค้นหาไฟล์ browscap.ini ของผู้ใช้และส่งคืนความสามารถของเบราว์เซอร์ของผู้ใช้
ไวยากรณ์
get_browser(user_agent,return_array)
ค่าพารามิเตอร์
Parameter | Description |
---|---|
user_agent | Optional. Specifies the name of an HTTP user agent. Default is the value of $HTTP_USER_AGENT. You can bypass this parameter with NULL |
return_array | Optional. If this parameter is set to TRUE, the function will return an array instead of an object |
รายละเอียดทางเทคนิค
คืนมูลค่า: | ส่งกลับวัตถุหรืออาร์เรย์ที่มีข้อมูลเกี่ยวกับเบราว์เซอร์ของผู้ใช้ที่ประสบความสำเร็จ หรือ FALSE เมื่อล้มเหลว |
---|---|
รุ่น PHP: | 4+ |
บันทึกการเปลี่ยนแปลง: | เพิ่ม พารามิเตอร์ return_arrayใน PHP 4.3.2 |
❮ PHP การอ้างอิงเบ็ดเตล็ด