我第一次使用 stream_get_content 。一切似乎都很好,直到我第二次尝试从流中读取内容。
如果我传递给 stream_get_content 的值是重复的,则返回空值!?
但如果我的价值不是重复一切都很好!!!!
public function makeAvatar($value)
{
$file_result = "data:image/gif;base64,";
$file_result .= base64_encode(stream_get_contents($value));
return $file_result;
}
Run Code Online (Sandbox Code Playgroud)