Editing file's hex at specific point in PHP?
<p>What I'm trying to accomplish:</p>

<p>I have two base files on my server that are edited/copied as needed based on user input. I'm hoping to do most of the work with the user input in javascript and the file editing in PHP, as I'm better with javascript. What I will need to do is edit the files at specific points and change the hex values based on the lengths of certain user-inputted strings. </p>

<p>I've done as much as I could without asking for help, but now I definitely need it. </p>

<p>The way one of the files is structured is: three null hex values, then a hex value equivalent to the length of a setting string, the setting string, three more null hex values, a hex value equivalent to the length of the setting's value string, and finally the value string. An example would be:</p>

<p><code>06 76 6F 6C 75 6D 65 00 00 00 02 37 38</code></p>

<p><code>06</code> is the length of the "volume" string,</p>

<p><code>76 6F 6C 75 6D 65</code> is the "volume" string,</p>

<p><code>02</code> is the length of the value string for volume, "78"</p>

<p><code>37 38</code> is the setting value, "78"</p>

<p>I can covert the user input to hex myself, but I don't know how to write to file in hex, or open it in hex, or go to the place I need to...</p>

<p>Also, for some reason, 000webhost won't let me upload txt files or the files I need to use, so is there a way to use zip files with php?</p>

<p>One last thing, how do I transfer variables between javascript and php without writing them to an html element?</p>
