I have a large (~6MB) binary “string”.
Now i’d like to replace some bytes withing a range of the string.
Let’s say, replace substring (binary, bytes) from offset 1024 with length 84 with another string (binary, bytes) with the same length (no data extending).
How can i do this with php so that the performance will not be very bad.
Thanks
Using
substr_replace()will create a new string and return its value; assigning it to the same variable should free its old value.