in php you would do one of the following
$browser = get_browser(null, true);
if($browser['browser'] == 'MSIE' && $browser['version'] >= 7) { /*CODE*/
OR
$u_agent = $_SERVER['HTTP_USER_AGENT'];
$bname = 'Unknown';
$version= "";
if(preg_match('/MSIE/i',$u_agent) && !preg_match('/Opera/i',$u_agent))
{
$bname = 'Internet Explorer';
}
// finally get the correct version number
$known = array('Version', $ub, 'other');
$pattern = '#(?<browser>' . join('|', $known) .
')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';
if (!preg_match_all($pattern, $u_agent, $matches)) {
// we have no matching number just continue
}
The IE Conditional statements only work after the page has been sent to the browser so PHP include files will not work, To include a JS script file you would use
<!--[if !(lt IE 7]>
<script src='script.js' type='text/javascript'></script>
<![endif]-->
For a javascript browser detection you would use:
if(BrowserDetect.browser == "MSIE" && BrowserDetect.version >= '7') {
/* CODE */
}