I bring in pkhp

print_r($_SERVER); 

Displays this for Safari

 [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2 

That's what chrome is for

 [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36 

Question: Why everywhere writes at the beginning of Mozilla / 5.0?

    2 answers 2

    Yes, the whole history of User-Agent 's is a sad story of non-compliance with standards, vendor extensions, the spread of their support across different browsers and attempts to identify the extensions / technologies supported by clients.

    Browsers vied with each other about supporting each other’s capabilities so that sites that give the full or compatible versions of certain User-Agent patterns "do not harm" the new browser that supposedly supports the necessary new items, but have to report it using "alien" elements in his User-Agent , because it was at that time that the sites were viewed.

    In addition to Mozilla/5.0 sometimes KHTML also unexpectedly found, like Gecko (Gecko is a Firefox engine) and Safari .

    In general, this is a serious historical legacy , which is now mockingly mocked ( Bruce Lawson, Opera Software, "How to destroy the Web", slide "A short sad story of the browser sniffing" ).
    According to Bruce, Mozilla prefix was added to browsers to declare support for frames .

    • one
      Sad reality. The truth now is a rudiment - everyone who needs to be determined is aware of this and does not pay attention. - user207618

    The use of Web sites User-agent to change the display of the page often leads to the fact that less popular browsers do not get the full content of the page, even if they can correctly display it, and in some radical cases, such browsers get nothing at all. In this regard, many browsers began to "hide" or "fake" User-agent.

    An early example of this is that Internet Explorer uses the User-Agent string beginning with "Mozilla / (compatible; MSIE ...") to get content intended for Netscape Navigator, its main competitor in the 1990s. It should be noted that "Mozilla" in in this case, not the open source browser Mozilla, released much later, but the original codename Navigator, which was also the name of Netscape’s mascot (mascot) from Netscape.This User-Agent string format has since been used by other browsers; for dominating Internet Explorer.

    When Internet Explorer became the dominant browser, competitors such as Firefox, Safari, and Opera built in systems that allow the user to choose a false User-Agent value, the same as in recent versions of Explorer. Some of them (Firefox and Safari) copied the User-Agent value completely, others (Opera) copied the User-Agent value, adding the true name of the browser at the end, which later resulted in the line containing three names and versions: the first one is called “ Mozilla (i.e., Netscape Navigator); hereafter "MSIE" (Internet Explorer); and last, a valid browser, such as Opera. Opera also allows you to completely disguise as Internet Explorer or Firefox, completely hiding the name "Opera".

    Taken from here

    • Mozilla - Mosaic killer . - user207618