PHP to detect mobile phones

The most efficient way to detect mobile phones with PHP, this simply queries the accept headers, the user agent and checks for any tell tale signs that the browser we’re sniffing is a mobile device.