/ Published in: PHP
Expand |
Embed | Plain Text
function thisDevice() { $useragent=$_SERVER['HTTP_USER_AGENT']; $device['specific'] = 'iPad'; $device['general'] = 'tablet'; $device['vague'] = 'mobile'; $device['specific'] = 'iPhone'; $device['general'] = 'phone'; $device['vague'] = 'mobile'; $device['specific'] = 'droidPhone'; $device['general'] = 'phone'; $device['vague'] = 'mobile'; } else { $device['specific'] = 'droidTab'; $device['general'] = 'tablet'; $device['vague'] = 'mobile'; } } else { $device['specific'] = 'unknown'; $device['general'] = 'unknown'; $device['vague'] = 'unknown'; } return $device; }
Comments
Subscribe to comments
You need to login to post a comment.

Returns an array of information on whether the device requesting the page is an ipod/iphone, android phone, ipad or android tablet.