how to detect internet explorer and firefox using PHP?

前端 未结 6 747
傲寒
傲寒 2021-01-29 09:05

how to detect internet explorer and firefox using PHP?

6条回答
  •  半阙折子戏
    2021-01-29 09:23

    To detect Firefox

    $isFirefox = (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') > -1);
    

    To detect IE

    $isIe = (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE ') > -1);
    

提交回复
热议问题