How to detect the useragent in PHP

To detect the useragent in PHP you can use the following snippet.

Sample PHP

<?php
	$useragent = $_SERVER ['HTTP_USER_AGENT'];
	echo "User Agent: " . $useragent; 
?>

Please Share us:
Please rate this snippet

One thought on “How to detect the useragent in PHP

Leave a Reply