There is no foolproof way, but you can look at the $_SERVER['HTTP_USER_AGENT'] value and parse it for things that indicate it. The [man]get_browser/man function can help with this, if you have a reasonably current browscap.ini file to use with it (and it still depends on each device sending values in the user agent HTTP header that it recognizes).