Jump to content

Fwrite


alphabeta12

Recommended Posts

I am working with files opened by fopen binary. Immediately these files are changed to hex via bin2hex. From there I do some processing of the hex. I have no clue as to how I should write the changes to a new file from that point. Can I get any help with writing hex to a file?The files that I use are pretty much unknown (they are kinda sorta images), and all that you can do to them is edit the hex, and I use PHP to do that.

Link to comment
Share on other sites

You can use the pack function to turn an ASCII hex string into binary data, and then use fwrite to write it back to the file. Make sure to use the b flag with fopen to open the file in binary mode.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...