The method of detecting what kind of browser you are serving described in this FAQ under section “How can I tell HTML browsers from WML browsers?” needs a large list of Agent strings, and this is obviously not an ideal solution. Furthermore, you might want to have special functionality for browsers with special capabilities. Such a list will help you detect which browser is being used.
We would like to point out the WURFL project that already has a big collection of user Agents.
Simpeler solutions would involve venturing guesses based on the useragents, for example if a user agent contains ‘Nokia’,’SonyEricsson’ and or few other manufacturer names, it is a safe bet that it is a mobile device. This might suffice for your purposes, provided your mobile site is simple enough to basically just work on ‘any’ device.