Return to Snippet

Revision: 19956
at November 4, 2009 05:14 by jfoucher


Initial Code
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;
}

Initial URL

                                

Initial Description

                                

Initial Title
detect browser to choose CSS file

Initial Tags
browser, simple

Initial Language
PHP