$agent = $_SERVER['HTTP_USER_AGENT'];
if(preg_match('/iPhone/i', $agent)){
echo "You're using Iphone";
} else if(preg_match('/Android/i', $agent)){
echo "You're using Iphone";
} else if(preg_match('/Blackberry/i', $agent)){
echo "You're using Blackberry";
}
How to ideas when run a mobile is how model name, ex: Iphone => show model is Iphone 4S
You can do that by using library called WURFL.
This this, you can just easily do: