For the past few years I have been using Gary Keith's browscap file to extract browser and OS information from the HTTP request. This method works absolutely fantastically, as long as the file is kept up to date. I have a cron job that ensures the file is kept up to date each day.

My questions, very simply, are:

  1. Is this the best method for extracting the browser/os information?
  2. When websites detect that you are browsing on a mobile are they using the same method?

I am asking purely out of curiosity in case there are better methods out there.

有帮助吗?

解决方案

Yes as long as the file is kept up to date I would say this is the best method.

As to whether other websites use the same thing, that answer can only be given if you've asked them ;-)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top