Created
November 7, 2013 16:30
-
-
Save stefano-bortolotti/7357479 to your computer and use it in GitHub Desktop.
Get the User Agent [PHP]
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
function getUA() { | |
static $browser; //No accident can arise from depending on an unset variable. | |
if ( !isset($browser) ) { | |
$browser = get_browser($_SERVER['HTTP_USER_AGENT']); | |
} | |
return $browser; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment