Get Unique web browser ID in PHP

后端 未结 2 1433
滥情空心
滥情空心 2021-01-03 11:20

I am looking a way to store unique ID of web browsers in PHP? I searched everywhere..but couldn\'t find any useful things. First of all, does web browsers have

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-03 11:53

    You can use the browscap library and then make an md5 of the browser information:

    Uses GaretJax/phpbrowscap

    $bc = new \phpbrowscap\Browscap('data/');
    $current_browser = $bc->getBrowser(null,true);
    $str = json_encode($current_browser);
    $browser_id = md5($str);
    

提交回复
热议问题