Simple user agent

When developing web applications sometimes is good to know which device it is visiting the site, the three most common ways to check for a device user agents are on JavaScript, Apache and PHP (” of course there is more ;) “), All techniques works good, it is all about taste of the person.

On php manual there is some good samples such this:

This will give you an good kick start to do a great project,

While doing this on client side, we could use navigator.userAgent, this javascript will out put something like this:
User-agent header sent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.152 Safari/537.22 one fun fact you may notice is that all browsers says Mozilla, except for Opera, so to learn more just read this post, quiet fun fact.


Leave a Reply

Your email address will not be published.