Created
September 7, 2017 07:48
-
-
Save abedputra/82aef9baa84f68b18e3b4d22a0990700 to your computer and use it in GitHub Desktop.
Check Firefox or Chrome with PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function is_chrome() | |
{ | |
return(eregi("chrome", $_SERVER['HTTP_USER_AGENT'])); | |
} | |
if(is_chrome()) | |
{ | |
echo "its Chrome"; | |
} | |
function is_firefox() | |
{ | |
return(eregi("firefox", $_SERVER['HTTP_USER_AGENT'])); | |
} | |
if(is_firefox()) | |
{ | |
echo "its Firefox"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment