1<?php
2
3// PHP code to get the MAC address of Client
4$MAC = exec('getmac');
5
6// Storing 'getmac' value in $MAC
7$MAC = strtok($MAC, ' ');
8
9// Updating $MAC value using strtok function,
10// strtok is used to split the string into tokens
11// split character of strtok is defined as a space
12// because getmac returns transport name after
13// MAC address
14echo "MAC address of client is: $MAC";
15?>