* (+/-)
<?php
echo identify_device($_SERVER['HTTP_USER_AGENT']);
function identify_device($device) {
$url = 'http://www.useragentstring.com/pages/'.
'useragentstring.php?typ=Mobile%20Browser';
$page = file_get_contents($url);
preg_match_all('~<li><a[^>]*>([^<]+)</a></li>~', $page, $devices);
$img = in_array($device, $devices[1]) ? 'mobile-phone.jpg' : 'computer-icon.jpg';
return '<img src="'. $img .'" width="25" height="25" alt="" />';
}