get_browser() function in PHP

WBOY
Release: 2023-09-09 18:42:01
forward
936 people have browsed it

get_browser() function in PHP

The get_browser() function finds the user's browscap.ini file and returns the capabilities of the user's browser.

Syntax

get_browser(user, return_array)
Copy after login

Parameters

  • user − The name of the HTTP user agent.

  • return_array − If this parameter is set to true, the function will return an array instead of an object.

Return value

The get_browser() function returns an object or array containing information about the user's browser.

Example

Note − Results will vary depending on the system.

Example

<?php
   echo $_SERVER[&#39;HTTP_USER_AGENT&#39;];
   $browseeInfo = get_browser();
   print_r($browserInfo);
?>
Copy after login

Output

The following is the output.

Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/70.0.3538.110 Safari/537.36
Copy after login

The above is the detailed content of get_browser() function in PHP. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!