To be short: forget it.
Your intention is somewhat strange.
Still, on server side you have to relay on the data sent by the client, more precisely the
User Agent[
^] header property. But that can be altered on client side with ease: there are plugins for merely all browsers that users can use to change this property, look at this one for example:
http://www.gtricks.com/google-chrome-tricks/change-user-agent-string/[
^]