sprintf() and hexadecimal formatting
Posted: Wed Mar 11, 2009 9:18 pm
I like to think I'm pretty clued up on how to use sprintf()/printf() to generating strings with the correct format, but I wonder of somebody can help me rule-out the possibility of doing this...
I don't think it's possible to do a single call and it requires some pre-processing of $val, but just on the off-chance does anyone know if there's a way?
Code: Select all
$val = 0xAFED78; //Pure integer value in hex
printf(" ... something to with =%02X ? ... ", $val);
/*
=AF=ED=78
*/