Last active
January 24, 2019 11:50
-
-
Save zohaib87/5a4a6e2bea8682bc19f7a28c5894d0b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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