Convert decimal to hex using PHP -


How to convert the decimal value into hex using PHP?

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

I like hex value this way

Hex: 44-37-E0-06 should -04-59 but instead its display 44-37-E0-6-4-59

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

This gives me the output: 44-37-E0-6-4-59 // without 06-04

output me Something like 44-37-E0-06-04-59

For 44-37-E0-06-04-59 just add 0 ,

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

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -