You could check the HTTP_USER_AGENT string sent in the request header. This is unique for each version of each browser. For instance you could check for the presence of 'iPhone' in the HTTP_USER_AGENT to identify iPhone users. You would need to identify all mobile phone browsers.
Or you could check the dimensions of the users viewport. If smaller than a certain size then direct to the 'mobile' phone version?
Just a thought... with mobile phone browsers getting ever more powerful is there always a need to go to a mobile phone version of the site? For instance the iPhone 4 has a massive 960x640 resolution! But I guess it is still a small form factor and users probably interact with it differently.