How to create a PHP detection browser script ? Last Updated : 10 Mar, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report A browser script is used to find the complete information of the web browser. A web browser is working on the hypertext transfer protocol and retrieves all the information on the internet and displays it on your desktop so that you can access all the things from anywhere. In this article, we will show how to retrieve the browser information in the below examples. Example: $_SERVER is the inbuilt function in the PHP used to display the information of various things. HTTP_USER_AGENT gives the browser details. The output is shown as the result you can get from the function when you run the script. PHP <?php echo "Your User Agent is :" . $_SERVER ['HTTP_USER_AGENT']."<br>"; ?> Output: Your User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36get_browser(): The get_browser() function in PHP is an inbuilt function that is used to tell the user about the browser’s capabilities. This function looks up the user’s browscap.ini file and returns the capabilities of the user’s browser. Syntax: get_browser($user_agent, $return_array)$user_agent: You can put a value equal to null because it takes the HTTP user_agent value but if you want to find the details of another browser then you can pass the user_agent of that browser.$return_array: It is boolean variable. If it is true, then it gives the result in an array otherwise returns an object.<pre> is used to display the array in human-readable form.Example: If you want more details of the browser then you can use the following function. PHP <?php $browser = get_browser(null, true); print "<pre>"; print_r($browser); print "</pre>"; ?> Output: Comment More infoAdvertise with us Next Article How to Install PHP on Linux? R rohanmittal1366 Follow Improve Article Tags : PHP Geeks-Premier-League-2022 PHP-Questions Similar Reads How to install XAMPP on Windows ? XAMPP is the most popular software package which is used to set up a PHP development environment for web services by providing all the required software components. During the process of software deployment, most of the web servers use almost similar components, so use of XAMPP provides easy transit 4 min read How to Install and Set up a WAMP Server ? Windows, Apache, MySQL and PHP is commonly abbreviated as WAMP. Some people may confuse with LAMP but the only difference between the two is their operating systems. In case of LAMP, L stands for Linux. Setting up a server included the installation of all the software listed in the abbreviation. Ano 3 min read How to install PHP in Windows 10? PHP is a general-purpose scripting language geared towards web development. It is an open-source software (OSS), which is free to download and use. PHP stands for "Hypertext Preprocessor". PHP files are saved with an extension called .php. It supports many databases MySQL, Oracle, etc.Installation o 2 min read How to Install PHP on Linux? PHP is a popular server-side scripting language that is especially used in web development. If you're working on a Linux environment, whether it's a personal development setup or a production server, you will likely need PHP installed. In this article, we will see the step-by-step guide to install P 2 min read How to Install PHP on MacOS? PHP (Hypertext Preprocessor) is known as a general-purpose scripting language that can be used to develop dynamic and interactive websites. It was among the first server-side languages that could be embedded into HTML, making it easier to add functionality to web pages without needing to call extern 3 min read How to set PHP development environment in windows ? What is PHP ? PHP (Hypertext PreProcessor) is a general-purpose programming language developed by Rasmus Lerdorf in 1994 for web development. This is one of the most popular programming language for beginners in web development because of its simplicity, large community and accessibility.Steps to se 3 min read How to set up a PHP Console ? PHP is a backend server-side language of web development. In general, we don't need to take input from the console but sometimes we need to run a small function or block of code, for which we need to take input from the console. Requirements: Server: xampp or WampServer How to set up PHP Console ? S 1 min read How to Install IMAP Extension in PHP on MacOS? Imap stands for Internet Message Access Protocol, It is a protocol used by email clients to retrieve email messages from mail servers, It is an application layer protocol in the OSI model. Imap allows us to store our messages on servers so that they can be accessed from multiple devices, whereas POP 4 min read How to Install PHP GD-library on CentOS? GD is an open-source code library that helps to create and manipulate PNG, JPEG, and GIF images in PHP. GD is commonly used for the development of websites. Image resizing, cropping, drawing, and adding effects to dynamic rendering can easily be done with its help. Picture handling and GD capacities 2 min read How to Install PHP Extensions on Windows? PHP is a general-purpose server scripting language. It is a powerful and important tool for developing dynamic and interactive Web pages. It is widely used, free, fast, flexible, and pragmatic. After installing PHP and a web server on Windows, extensions are also needed because they provide added fu 2 min read Like