regex - How to detect "Google Chrome" as the user-agent using PHP? -


I am interested in knowing whether the server on PHP user-agent is using "Chrome" on Chrome . Is there a reliable regular expression for parsing the user-agent string from the request header?

On this point, many browsers are pretending to be Chrome so that their popularity A common match for "Chrome" has to face browser identification abuse. I advise to proceed with the facility of inquiry, but Chrome is notorious for lying to the mechanisms of detecting well (as a webkit / nap) as well, so it is not as good as it is And also breaks.

I can only recommend staying on top of things by comparing your known UA strings with other browsers through third-party sites and by creating patterns from there. How do you do it yourself completely depend on the stars Just keep in mind that due to the nature of browsers and UA stars, there can never be a "reliable" regular expression to match them.

In PHP, the related server is the server $ _ server ['HTTP_USER_AGENT'] .


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -