Convert decimal to hex using PHP -


how convert decimal value hex using php?

dec : 68-55-230-06-04-89

i want hex value this

hex : 44-37-e0-06-04-59 instead of display 44-37-e0-6-4-59

echo $test = dechex(68)."-".dechex(55)."-".dechex(230)."-".dechex(06)."-".dechex(04)."-".dechex(89); 

it's give me output : 44-37-e0-6-4-59 // without 06-04

i want output 44-37-e0-06-04-59

for getting 44-37-e0-06-04-59 add 0 below,

sprintf('%02x-%02x-%02x-%02x-%02x-%02x', 68, 55, 230, 06, 04, 89); 

Comments