- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
get_browser() function in PHP
The get_browser() function looks up the user's browscap.ini file and returns the capabilities of the user's browser.
Syntax
get_browser(user, return_array)
Parameters
user − The name of HTTP user agent.
return_array − If this parameter is set to true, the function will return an array instead of an object.
Return
The get_browser() function returns object or array with information about browser of user.
Example
Note − The result will vary system to system.
Example
<?php echo $_SERVER['HTTP_USER_AGENT']; $browseeInfo = get_browser(); print_r($browserInfo); ?>
Output
The following is the output.
Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/70.0.3538.110 Safari/537.36
Advertisements