What's the best way to detect a browser with php?

后端 未结 5 955
我在风中等你
我在风中等你 2021-01-21 08:13

Could anyone tell me the best way to detect a browser using php? IE 6 and 7 are terrible when it comes to achieving full browser compatibility with CSS so my site isn\'t going t

5条回答
  •  广开言路
    2021-01-21 08:52

    (Silly answer alert.)

    If you're only interested in detecting IE6 and 7, you could create an intermediary page:

    That would be the entire page, as is. (You could add some stuff for people who don't have JS enabled, if you wanted.)

    Then, when it goes to the next page, you can have this PHP:

    $location = empty($_GET['too_old']) ? 'good_page.wherever' : 'bad_page.whatever';
    header('Location: '.$location);
    

    inb4 "But there are lots of ways to break this."

提交回复
热议问题