Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   How can we get the browser properties using PHP? (https://www.warriorforum.com/programming/1139477-how-can-we-get-browser-properties-using-php.html)

AdneyP 7th December 2015 02:13 AM

How can we get the browser properties using PHP?
 
How can we get the browser properties using PHP?

robomedia 7th December 2015 02:21 AM

Re: How can we get the browser properties using PHP?
 
Which properties?
Generally PHP resides on your server and it has nothing to do with the client ( web browser ) .
You can get only what browser sends you : referrer and user agent string .
There's some php function get_browser() that will get some info based on user agent string (PHP: get_browser - Manual) .

But generally Javascript is the language that talks directly with your browser, so you might gather the required information with javascript and then send it to server by ajax.

Yadav Poonam 7th December 2015 02:22 AM

Re: How can we get the browser properties using PHP?
 
You can use get_browser() function

$browser_details = get_browser(null, true);
print_r($browser_details);

eluminoustechnologies 7th December 2015 02:56 AM

Re: How can we get the browser properties using PHP?
 
Here's the code

<?php
echo $_SERVER['HTTP_USER_AGENT'] . “\n\n”;
$browser = get_browser();
print_r($browser);
?>


All times are GMT -6. The time now is 06:09 AM.