- Version
- Download 120
- File Size 396.02 KB
- File Count 1
- Create Date September 5, 2016
- Last Updated September 5, 2016
Browser detector script in PHP
Browser detector script in PHP
Simple program in PHP that will determine what type of browser you are using.
PHP Script:
< ?php
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE)
echo 'You are now using Internet explorer';
elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') !== FALSE) //For Supporting IE 11
echo 'You are now using Internet explorer';
elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== FALSE)
echo 'You are now using Mozilla Firefox';
elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== FALSE)
echo 'You are now using Google Chrome';
elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mini') !== FALSE)
echo "You are now using Opera Mini";
elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== FALSE)
echo "You are now using Opera";
elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') !== FALSE)
echo "You are now using Safari";
else
echo 'You are now using Something else';
? >