I'm storing an entire html page in $html. I need to replace everything from <head> to </head> with my own $head (so either the stuff inside is replaced, or the stuff inside and the tags - whichever makes more sense). How can I do this?
There are times when I have encountered the need to decompress a response from a PHP request.
This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.