You can use PHP $ _SERVER ['HTTP_USER_AGENT'] and then case-insensitive eregi functions to look for the following, which assumes that the browser developer has followed Android's recommendations for user agent specifications:
$ua = $_SERVER['HTTP_USER_AGENT']; if (eregi('Android', $ua) && eregi('Mobile', $ua)) $platform = "Android Phone"; elseif (eregi('Android', $ua) && !eregi('Mobile', $ua)) $platform = "Android Tablet";
It is not perfect, but it is the beginning.
user336828
source share