lotsofes/helpers/browser.php

14 lines
512 B
PHP
Raw Normal View History

<?php
$ua = $_SERVER['HTTP_USER_AGENT'];
if (preg_match('/Chrome/i',$ua)) include "browsers/chrome.php";
elseif (preg_match('/Firefox/i',$ua)) include "browsers/firefox.php";
elseif (preg_match('/MSIE/i',$ua) && !preg_match('/Opera/i',$ua)) include "browsers/ie.php";
elseif (preg_match('/.NET/i',$ua)) include "browsers/ie.php";
elseif (preg_match('/Trident/i',$ua)) include "browsers/ie.php";
elseif (preg_match('/Konqueror/i',$ua)) include "browsers/konqueror.php";
else include "browsers/firefox.php";
?>