Welcome folks today in this blog post we will be
finding mac address of a device using system command in browser using
php 7. All the full source code of the application is shown below.
In order to get started you need to make an
index.php file and copy paste the following code
<?php //Buffering the output ob_start(); //Getting configuration details system('ipconfig /all'); //Storing output in a variable $configdata=ob_get_contents(); // Clear the buffer ob_clean(); //Extract only the physical address or Mac address from the output $mac = "Physical"; $pmac = strpos($configdata, $mac); // Get Physical Address $macaddr=substr($configdata,($pmac+36),17); //Display Mac Address echo $macaddr; ?>