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?