Skip to content

Instantly share code, notes, and snippets.

@zohaib87
Last active January 24, 2019 11:50
Show Gist options
  • Save zohaib87/5a4a6e2bea8682bc19f7a28c5894d0b2 to your computer and use it in GitHub Desktop.
Save zohaib87/5a4a6e2bea8682bc19f7a28c5894d0b2 to your computer and use it in GitHub Desktop.
// Turn on output buffering
ob_start();
// Get the ipconfig details using system commond
system('ipconfig /all');
// Capture the output into a variable
$mycom = ob_get_contents();
// Clean (erase) the output buffer
ob_clean();
$findme = "Physical";
// Search the “Physical” | Find the position of Physical text
$pmac = strpos($mycom, $findme);
// Get Physical Address
$mac = substr($mycom,($pmac+36),17);
$mac = str_replace('-', ':', strtolower($mac));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment