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

前端 未结 16 2370
长发绾君心
长发绾君心 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:06

    We can get MAC address in Ubuntu by this ways in php

    $ipconfig =   shell_exec ("ifconfig -a | grep -Po 'HWaddr \K.*$'");  
        // display mac address   
     echo $ipconfig;
    

提交回复
热议问题