Home >Backend Development >PHP Tutorial >PHP gets the client mac address program code_PHP tutorial
The mac address is the network card address. Generally, the user's mac address cannot be obtained. Because of security restrictions on the browser, it is almost impossible to obtain it. Here are two pieces of code for everyone to play with.
Example 1
PHP code:
代码如下 | 复制代码 |
@exec("arp -a",$array); //执行arp -a命令,结果放到数组$array中 echo " "; |
Example 2
代码如下 | 复制代码 |
class MacAddr |
There is no big problem in getting the server-side logic, but there may be permission issues.
When obtaining the client, it may be slow, and the execution of the arp/nbstat command will be slow.
The code is as follows
|
Copy code
|
||||