*Transferred from PHP blog...
I was working on browser detection code so I can include different stylesheet for different browser today, I found that the code is different for linux and windows, so beware...in case you need it.
# Browser detection code
function BrowserDetect($agent)
{
# Linux PHP
global $HTTP_USER_AGENT;
return eregi($agent, $HTTP_USER_AGENT);
# For Windows PHP
#global $HTTP_ENV_VARS;
#return eregi($agent, $HTTP_ENV_VARS["HTTP_USER_AGENT"]);
}
?>
I was working on browser detection code so I can include different stylesheet for different browser today, I found that the code is different for linux and windows, so beware...in case you need it.
# Browser detection code
function BrowserDetect($agent)
{
# Linux PHP
global $HTTP_USER_AGENT;
return eregi($agent, $HTTP_USER_AGENT);
# For Windows PHP
#global $HTTP_ENV_VARS;
#return eregi($agent, $HTTP_ENV_VARS["HTTP_USER_AGENT"]);
}
?>

0 Comments:
Post a Comment
<< Home