How to Get MAC Address of System using PHP

  1. ?php  
  2.    // Turn on output buffering  
  3.    ob_start();  
  4.    //Get the ipconfig details using system commond  
  5.    system('ipconfig /all');  
  6.    // Capture the output into a variable  
  7.    $mycomsys=ob_get_contents();  
  8.    // Clean (erase) the output buffer  
  9.    ob_clean();  
  10.    $find_mac = "Physical"//find the "Physical" & Find the position of Physical text  
  11.    $pmac = strpos($mycomsys$find_mac);  
  12.    // Get Physical Address  
  13.    $macaddress=substr($mycomsys,($pmac+36),17);  
  14.    //Display Mac Address  
  15.    echo $macaddress;  
  16.    
  17. ?>