How can I get the MAC and the IP address of a connected client in PHP?

前端 未结 16 2354
长发绾君心
长发绾君心 2020-11-22 02:29

I need to know the MAC and the IP address of the connect clients, how can I do this in PHP?

16条回答
  •  礼貌的吻别
    2020-11-22 03:03

    You can get MAC Address or Physical Address using this code

    $d = explode('Physical Address. . . . . . . . .',shell_exec ("ipconfig/all"));  
    $d1 = explode(':',$d[1]);  
    $d2 = explode(' ',$d1[1]);  
    return $d2[1];
    

    I used explode many time because shell_exec ("ipconfig/all") return complete detail of all network. so you have to split one by one. when you run this code then you will get
    your MAC Address 00-##-##-CV-12 //this is fake address for show only.

提交回复
热议问题