Home  >  Article  >  Backend Development  >  Use PHP to detect whether the browser currently used by the user is IE_PHP Tutorial

Use PHP to detect whether the browser currently used by the user is IE_PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 17:18:02873browse

Copy code The code is as follows:

/**
* Detect the user’s current browser
* @return boolean whether it is Internet Explorer
*/
function chk_ie_browser() {
$userbrowser = $_SERVER['HTTP_USER_AGENT'];
if ( preg_match( '/MSIE/i', $userbrowser ) ) {
$usingie = true;
} else {
$usingie = false;
}
return $usingie;
}

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/621704.htmlTechArticleCopy the code The code is as follows: /*** Detect the user's current browser * @return boolean whether it is IE browser*/ function chk_ie_browser() { $userbrowser = $_SERVER[ 'HTTP_USER_AGENT']; if ( pre...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn