<?php
$str = $_SERVER['HTTP_USER_AGENT'];
$pos1 = strpos($str, "Chrome");
$pos2 = strpos($str, "Firefox");
$pos3 = strpos($str, "MSIE");
if($pos1 != '') $user_agent = "Chrome";
else if($pos2 != '') $user_agent = "Firefox";
else if($pos3 != '') $user_agent = "IE";
echo $user_agent;
?>
Comments
Post a Comment