Should it not be:
$hex = sprintf("%2x", $char);with 2 instead of 1?
Update: Yes, of course, %02x
Rule One: "Do not act incautiously when confronting a little bald wrinkly smiling man."
In reply to Re: dump text file in ASCII and hex
by psini
in thread dump text file in ASCII and hex
by kevind0718
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |