функция определяет 17 браузеров для ПК и 13 мобильных браузеров
function detect_browser(){
$user_agent = $_SERVER['HTTP_USER_AGENT'];
if(strpos($user_agent, 'Presto')){
$b = 'Opera';
} elseif(strpos($user_agent, 'Orca')) {
$b = 'Orca';
} elseif(strpos($user_agent, 'Lunascape')) {
$b = 'Lunascape';
} elseif(strpos($user_agent, 'CoolNovo')) {
$b = 'CoolNovo';
} elseif(strpos($user_agent, 'Kylo')) {
$b = 'Kylo';
} elseif(strpos($user_agent, 'Flock')) {
$b = 'Flock';
} elseif(strpos($user_agent, 'RockMelt')) {
$b = 'RockMelt';
} elseif(strpos($user_agent, 'CometBird')) {
$b = 'CometBird';
} elseif(strpos($user_agent, 'SeaMonkey')) {
$b = 'SeaMonkey';
} elseif(strpos($user_agent, 'Iron')) {
$b = 'SRWare iron';
} elseif(strpos($user_agent, 'Firefox')) {
$b = 'Firefox';
} elseif(strpos($user_agent, 'YaBrowser')) {
$b = 'Yandex Browser';
} elseif(strpos($user_agent, 'Chrome')) {
$b = 'Chrome';
} elseif(strpos($user_agent, 'MSIE')) {
$b = 'Internet Explorer';
} elseif(strpos($user_agent, 'Maxthon')) {
$b = 'Maxthon';
} elseif(strpos($user_agent, 'Safari')) {
$b = 'Safari';
} elseif(strpos($user_agent, 'QtWeb')) {
$b = 'QtWeb Internet Browser';
/* Мобильные устройства*/
} elseif(strpos($user_agent,"iPod")) {
$b = 'iPod';
} elseif(strpos($user_agent,"iPhone")) {
$b = 'iPhone';
} elseif(strpos($user_agent,"Android")) {
$b = 'Android';
} elseif(strpos($user_agent,"Symbian")) {
$b = 'Symbian';
} elseif(strpos($user_agent,"WindowsPhone")) {
$b = 'WindowsPhone';
} elseif(strpos($user_agent,"WP7")) {
$b = 'WP7';
} elseif(strpos($user_agent,"WP8")) {
$b = 'WP8';
} elseif(strpos($user_agent,"Opera M")) {
$b = 'Opera M';
} elseif(strpos($user_agent,"webOS")) {
$b = 'webOS';
} elseif(strpos($user_agent,"BlackBerry")) {
$b = 'BlackBerry';
} elseif(strpos($user_agent,"Mobile")) {
$b = 'Mobile';
} elseif(strpos($user_agent,"HTC_")) {
$b = 'HTC_';
} elseif(strpos($user_agent,"Fennec/")) {
$b = 'Fennec';
} else {
$b = 'Не определено';
}
return $b;
}