Reputation: 173
How to get complete device information of users using PHP or Javascript.
Upvotes: 3
Views: 4754
Reputation: 774
Use Browsecap database for this purpose.
get_browser function from php uses user agent to get Information about device , os , browser etc.
You need to regularly update browsecap.ini file regularly to keep updated with latest Devices and Browsers.
Installation : download browsecap.ini from
Move file to
/etc/php.d/browscap.ini
Then add below lines to php.ini
[browscap]
; http://php.net/browscap
browscap = "/etc/php.d/browscap.ini"
Restart webserver to apply changes
And now you can use get_browser() function
<?php
$browser = get_browser();
print_r($browser);
?>
Upvotes: 1
Reputation: 15
You can get easily using PHP.
echo $_SERVER['HTTP_USER_AGENT'];
Or,
$browserInfo = get_browser(null, true);
print_r($browserInfo);
Upvotes: 1
Reputation: 121
Check the below links will help you get started on that issue https://www.visitorjs.com/ https://tutorialedge.net/javascript/retrieving-visitor-information-javascript/
Upvotes: 0