Posted By

mariraj on 09/08/11


Tagged

mac


Versions (?)

Find mac address


 / Published in: PHP
 

find a mac address using php

  1. exec("ipconfig /all", $output);
  2. foreach($output as $line){
  3. if (preg_match("/(.*)Physical Address(.*)/", $line)){
  4. $mac = $line;
  5. $mac = str_replace("Physical Address. . . . . . . . . :","",$mac);
  6. }
  7. }
  8. echo trim($mac);

Report this snippet  

You need to login to post a comment.