What would be equivalent function to file_get_contents
, which reads the whole content of a text file written using gzwrite
function?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
I'm not sure how it would handle gz file header.
This is way easier using stream wrappers
https://stackoverflow.com/a/8582042/1235815
I tried @Sfisioza's answer, but I had some problems with it. It also reads the file twice, once and non-compresses and then again as compressed. Here is a condensed version:
It would obviously be gzread .. or do you mean file_put_contents ?
Edit: If you don't want to have a handle, use readgzfile.
I wrote a function I was looking for, based on the comments in the manual: