detect browser to choose CSS file
Copy this code and paste it in your HTML
function queBrowser() {
$user_agent = isset($_SERVER['HTTP_USER_AGENT']) ?
$_SERVER['HTTP_USER_AGENT'] : ''; if (strpos($user_agent, 'Opera') !== false) {$browser = 'opera'; } elseif (strpos($user_agent, 'Chrome') !== false) {$browser = 'estilos'; } elseif (strpos($user_agent, 'Firefox/2') !== false) {$browser = 'estilos'; } elseif (strpos($user_agent, 'Firefox/3') !== false) {$browser = 'estilos'; } elseif (strpos($user_agent, 'Firefox') !== false) {$browser = 'estilos'; } elseif (strpos($user_agent, 'Shiretoko') !== false) {$browser = 'estilos'; } elseif (strpos($user_agent, 'Safari') !== false) {$browser = 'estilos'; } elseif (strpos($user_agent, 'MSIE 6') !== false) {$browser = 'estilos-ie6'; } elseif (strpos($user_agent, 'MSIE 7') !== false) {$browser = 'estilos-ie7'; } elseif (strpos($user_agent, 'MSIE 8') !== false) {$browser = 'estilos-ie8'; } elseif (strpos($user_agent, 'MSIE') !== false) {$browser = 'estilos-ie'; } else {$browser = 'Otro';
}
return $browser;
}
Report this snippet
Comments
Subscribe to comments