Last active
December 20, 2015 11:19
-
-
Save boy3vil/6122749 to your computer and use it in GitHub Desktop.
This file contains 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
$_SERVER['HTTP_USER_AGENT'] | |
hasil : | |
Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543 Safari/419.3 | |
cek------------------------ | |
<?php | |
$user_agent = $_SERVER['HTTP_USER_AGENT']; | |
if (preg_match('/MSIE/i', $user_agent)) { | |
echo "Internet Explorer"; | |
} else { | |
echo "Non-IE Browser"; | |
} | |
?> | |
--------------------------- | |
ganti MSIE dengan web browser yg sesuai | |
list browser | |
Internet Explorer: MSIE | |
Mozilla Firefox: Firefox | |
Google Chrome: Chrome | |
Apple Safari: Safari | |
Opera: Opera | |
Netscape Navigator: Netscape | |
Flock: Flock | |
Lynx: Lynx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment