Re: Any SNMP Guru's?
| From: | Mike Mackintosh | Date: | Thu, 15 Mar 2012 21:06:33 +0000 |
| Subject: | Re: Any SNMP Guru's? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-317051@lists.php.net to get a copy of this message | ||
I don't not think there is a way without patching snmp.c prior to PHP configuring.
You can always do:
$segment = explode(":", $macaddress);
foreach($segment as $seg){
$hex[] = str_pad($seg, 2, 0, STR_PAD_LEFT);
}
$macaddress = implode(":", $hex);
or use a preg replace function and match
Mike Mackintosh
PHP, the drug of choice - www.highonphp.com
On Mar 15, 2012, at 4:12 PM, David OBrien wrote:
> Using command line snmpget you can set an option to append leading 0's to
> hex values -o0
> So instead of
>
> $macaddress = "0:1a:4b:c:8d:fb";
>
> it would be
>
> $macaddress = "00:1a:4b:0c:8d:fb";
>
> is there any option using the extremely well documented php snmp extension
> to do the same?