Hey all,
I want to have information of IP configuration in PHP file.we are using ipconfig/all at the command prompt and can get the result.But I want to have that in php file.I used below code, but dint work..
$mac = getMac();
$mac = trim($mac);
function getMac(){
exec("ipconfig /all", $output);
foreach($output as $line){
if (preg_match("/(.*)Physical Address(.*)/", $line)){
$mac = $line;
$mac = str_replace("Physical Address. . . . . . . . . :","",$mac);
}
}
return $mac;
}
can you please help me where I am wrong ?