How to get Browser Information In PHP

A Browser is application software used to open web pages from servers or over the internet. A browser is application software which displays content from the World Wide Web, which includes images, video etc. Today there are many browsers available in the market.
Some browsers are as follows:

  • Intenet Explorer
  • Firebox
  • Google Chrome
  • Safari etc…
  • To Find Browser Name in PHP
    If you want to know a browser name through PHP then you can do that. For this purpose you will use the following code.

    <h4>Browser Information</h4>
    $browser="Internet Explorer";
    else if(strrpos(strtolower($_SERVER["HTTP_USER_AGENT"]),strtolower("Presto")))
    else if(strrpos(strtolower($_SERVER["HTTP_USER_AGENT"]),strtolower("CHROME")))
    $browser="Google Chrome";
    else if(strrpos(strtolower($_SERVER["HTTP_USER_AGENT"]),strtolower("SAFARI")))
    else if(strrpos(strtolower($_SERVER["HTTP_USER_AGENT"]),strtolower("FIREFOX")))
    echo "Your Browser is :" .$browser;

    Recommended Tutorials for you


    Anuj kumar

    This is Anuj Kumar. I’m a professional web developer with 5+ years of experience. I write blogs in my free time. I love to learn new technologies and share with others. I founded PHPGurukul in September 2015. The main aim of this website to provide PHP, Jquery, MySQL, PHP Oops and other web development tutorials. .

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Back to top button