I want to modify a binary file server side of aprox. 700kb to change an url in it than save it.
My first idea was to use bin to hex and preg_replace to replace url in binary.
The adress for the url in binary is always the same, but i need to change it every time my function is called.
Is there a better/faster way to do this ?
Example:
somesite.com/api***
I want to replace *** with some numbers from a var for example.
*** is between hex adress 00010edb-00010edd
Thanks!
If the string is at fixed position, you can write data directly: