Editing file’s hex at specific point in PHP?

What I’m trying to accomplish: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...