Posted By

i0ni on 01/23/11


Tagged

browser user agent


Versions (?)

Detect user agent


 / Published in: PHP
 

  1. function browser(){
  2. $keyname_ua_arr = array('HTTP_X_DEVICE_USER_AGENT', 'HTTP_USER_AGENT');
  3. foreach ($keyname_ua_arr as $keyname_ua) {
  4. if (!emptyempty($_SERVER[$keyname_ua])){
  5. $ua = $_SERVER[$keyname_ua];
  6. break;
  7. }
  8. }
  9. return $ua;
  10. }

Report this snippet  

You need to login to post a comment.