Wednesday, March 4, 2020

How to get web browser information in PHP?

In order to get web browser information in php use the following code.

Without browscap.ini file

<?php
echo $_SERVER['HTTP_USER_AGENT'];
?>

With browscap.ini file

<?php
$browser = get_browser(null, true);
echo "<pre>";
print_r($browser);
echo "</pre>";
?>

No comments:

Post a Comment