Is there any way to differentiate IE7 versus IE6 using PHP's get_browser() function?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- How to fix IE ClearType + jQuery opacity problem i
- Can php detect if javascript is on or not?
I read that get_browser() is a relatively slow function, so I was looking for something speedier. This code checks for MSIE 7.0, outputting "Otay!" if true. It's basically the same answer as the previous post, just more concise. Fairly straightforward if statement:
If your logic is to decide what stylesheets or scripts to include, it maybe worth going the HTML route of conditional comments:
That way you get around any custom browser strings and the like. More info at QuirksMode.
You can do so as such:
A quick look to the official
get_browser()
documentation would of answered your question. Always read the documentation before.I found a different, really simple solution for a PHP IE6 conditional that I was able to edit for my own purposes:
The full script can be found here:
http://www.thatgrafix.com/php_detect/
Below is a complete example taken from here.