16
11
Read Time:25 Second
Today I will explain how to check what browser visitors are using with the help of user agent strings our default browser sends as a part of the HTTP request. The variable we can use to check browser is
$_server[‘http_user_agent’]
$_SERVER is a reserved super global PHP variable that contains all the web server informations.
Lets see the example and its output result.
<?php
echo $_SERVER[‘HTTP_USER_AGENT’];
?>
———————
Output
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
About Post Author
Vishal Barot
Hi there, Vishal Barot here. Full-time web developer and graphic designer with over 10 years of experience. I've been experimenting with web development since I was 17 years old. If you are looking to have a professional website or design then I can develop it for you. Looking forward to working with you.