Posted By

aristoworks on 12/23/08


php browser detection Firefox

Versions (?)

Who likes this?

3 people have marked this snippet as a favorite


PHP Firefox Detector

 / Published in: PHP


This handy little script will allow you to detect whether or not a user is running FireFox as their browser.

  1. function is_firefox() {
  2. $agent = '';
  3. // old php user agent can be found here
  4. if (!empty($HTTP_USER_AGENT))
  5. $agent = $HTTP_USER_AGENT;
  6. // newer versions of php do have useragent here.
  7. if (empty($agent) && !empty($_SERVER["HTTP_USER_AGENT"]))
  8. $agent = $_SERVER["HTTP_USER_AGENT"];
  9. if (!empty($agent) && preg_match("/firefox/si", $agent))
  10. return true;
  11. return false;
  12. }

Report this snippet  


RSS Icon Subscribe to comments
Posted By: Jacky888 on October 13, 2018

the 8 best rechargeable batteries for led torch

You need to login to post a comment.