What is the method used in php to get the browser properties?

Discussion in 'HTML & Website Design' started by techendeavour, Sep 2, 2011.

  1. #1
    I would like to get the browser properties using php, which method is used for that, kindly tell me?
     
    techendeavour, Sep 2, 2011 IP
  2. Kerosene

    Kerosene Alpha & Omega™ Staff

    Messages:
    11,366
    Likes Received:
    575
    Best Answers:
    4
    Trophy Points:
    385
    #2
    <?php echo $_SERVER["HTTP_USER_AGENT"]; ?>
    You can also use get_browser.
     
    Kerosene, Sep 2, 2011 IP
  3. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #3
    USER_AGENT will tell you what the browser claims it is - but most browsers can be made to lie. get_browser does the same thing, it looks up the capabilities of the browser in a file on the server, using the data the browser claims.

    jQuery's "support" is better, since it tells you whether the browser supports the function you need to know about. Just send the information from the client to the PHP page (use AJAX). (Regardless of what the browser claims to be, support reports what the browser's engine is capable of.)
     
    Rukbat, Sep 2, 2011 IP
  4. HalvinCarris

    HalvinCarris Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    What's the information you're trying to get? PHP is not able to pass on all properties of the browser.
     
    HalvinCarris, Sep 3, 2011 IP