Detect mobile browser/user agent with PHP (iPad, iPhone, Android, BlackBerry, WP7 and others)
With all this load of smartphones and tablets, it is mandatory for us as developers to optimize our content as much as possible so everybody can see it, no matter what device they are using. This is why I wrote a small but powerful function to properly detect a wide range of mobile devices and redirect to an special content accordingly.