Re: How to obtain MAC address of server where PHP is running
| From: | Gerard Samuel | Date: | Sat, 29 May 2004 17:09:24 +0000 |
| Subject: | Re: How to obtain MAC address of server where PHP is running | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-187198@lists.php.net to get a copy of this message | ||
On Saturday 29 May 2004 12:35 pm, Andrei Verovski (aka MacGuru) wrote:
> Hi, Gerard,
>
> Can you please be so kind to post your code snippet you have described
> below?
>
<?php
ob_start();
passthru('/sbin/ifconfig | grep ether');
$dump = ob_get_contents();
preg_match('/[A-F0-9]{2}:[A-F0-9]{2}:[A-F0-9]{2}:[A-F0-9]{2}:[A-F0-9]{2}:
[A-F0-9]{2}/i', $dump, $mac);
$mac_address = $mac[0];
ob_end_clean();
?>