Any php code to detect the browser with version and operating system?

后端 未结 4 2094
面向向阳花
面向向阳花 2020-12-03 12:13

I tried to search in google but cannot find a complete solution (i only find something detects only the browser\'s type like firefox, opera) .

i want a php class or

4条回答
  •  悲哀的现实
    2020-12-03 13:03

    get_browser() gives you browser version and operating system

    $browser = get_browser();
    
    foreach ($browser as $name => $value) {
        echo "$name $value\n";
    }
    
    output:
    browser_name_pattern: Mozilla/4\.5.*
    parent: Netscape 4.0
    platform: Linux
    ...
    

提交回复
热议问题