PHP funkce get_browser()

Dostupnost ve verzích: PHP 4.0

Tells what the user's browser is capable of

Parametry

Parametr Datový typ Výchozí hodnota Poznámka
$user_agent string null, The User Agent to be analyzed. By default, the value of HTTP User-Agent header is used; however, you can alter this (i.e., look up another browser's info) by passing this parameter.
$return_array bool null If set to true, this function will return an array instead of an object.

mixed

The information is returned in an object or an array which will contain various data elements representing, for instance, the browser's major and minor version numbers and ID string; true/false values for features such as frames, JavaScript, and cookies; and so forth.

The cookies value simply means that the browser itself is capable of accepting cookies and does not mean the user has enabled the browser to accept cookies or not. The only way to test if cookies are accepted is to set one with setcookie, reload, and check for the value.

Další zdroje

Oficiální dokumentace funkce get-browser

AI konzultace & implementace

Pomohu vám zavést AI do vašeho projektu– od analýzy a návrhu řešení až po nasazení do produkce. Ušetřete čas, zjednodušte procesy a získejte konkurenční výhodu.

Domluvit konzultaci
Konzultant: Jan Barášek
Potřebujete poradit s PHP?

Nabízím trénink vývojářů, konzultace, školení a analýzu návrhových vzorů. Osobně v Praze nebo online.

Napište mi

Newsletter

Nejlepsi tipy a triky o PHP do Vaseho e-mailu. Clanky a novinky nejen ze sveta PHP a programovani.