I'm trying to read from the php://memory
wrapper using fread()
but fread()
always returns false. My code is simplified:
$file_handle = fopen('php://memory', 'w+'); // Have tried php:temp also.
fwrite($file_handle, 'contents');
$file = fread($file_handle, filesize($file_handle)); // Have also tried 99999 for filesize.
$file
always is false after the fread()
.
What's going on?
Thanks in advance!