Mobile Detect uses a lightweight PHP class for detecting mobile devices (including tablets).