Mobile Safari is a very capable browser, and it can handle my website as it is perfectly. However, there are a few elements on my page that could be optimized for browsing using this device; such as serving specific thumbnails that are smaller than the desktop counterparts to help fit more content into the screen.

I would like to know how I can detect Mobile Safari (all versions, preferably) using PHP, so then I can serve a) a specific css file and b) different sized image thumbnails.