Mobile Detect – lightweight PHP class for detecting mobile devices (including tablets)

Mobile Detect is a lightweight PHP class for detecting mobile devices. It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.

http://mobiledetect.net/