Re: Any SNMP Guru's?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux