I know that in PHP we can access a header
called User-Agent
and thus discover information about the operating system and browser, used by the client.
The only thing I do not understand is that "Mozilla /5.0" always appears (even if I use a browser other than Firefox).
Example:
print_r($_SERVER['HTTP_USER_AGENT']);
Output:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:39.0) Gecko/20100101 Firefox/39.0
This string above was returned from PHP. I was using Firefox 39.0
in my tests. However, if I did this with another browser, I would return "Mozilla / 5.0"
So here are two questions (I'll be happy if only the first one is answered):
- Why does this header return the browser name, also returns "Mozilla /5.0"? Is it something else that has no relationship with Firefox?