Find mac address


/ Published in: PHP
Save to your folder(s)

find a mac address using php


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.