我试图从php://memory
包装器中读取,fread()
但fread()
总是返回 false。我的代码被简化:
$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
之后总是假的fread()
。
这是怎么回事?
提前致谢!