ทดสอบเขียน Gist by Github
ทดสอบครับ
ตัวอย่างสคริปต์ PHP แสดง MAC Address
ตัวอย่างสคริปต์ PHP แสดง MAC Address
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
<?php | |
// 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); | |
//Display Mac Address | |
echo "MAC4 : " . $mac; | |
?> |
ความคิดเห็น
แสดงความคิดเห็น