How can we get the browser properties using PHP?

There may be times where one finds themselves in a situation having the need to look up the browser properties. One can do this via the use of PHP code, specifically the Echo command.

The following code will return an array of the browser name, version and platform.

<html>
<body>

<?php
echo $_SERVER['HTTP_USER_AGENT'];
$browser = get_browser();
print_r($browser);
?>

</body>
</html>

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.