黑猫警长1000000000 (@Hmjz100) 在 【求助】PHP 代码流式传输问题 中发帖
如题,网上的代码拼拼凑凑成了下面这样,文件是实时写入了,但是还是不能流式返回数据,佬们帮看看怎么弄才能支持流式返回数据
$apiKey = '';
$apiUrl = '';
ini_set('output_buffering', 'off');
ini_set('zlib.output_compression', false);
while (ob_end_flush()) {}
header('Content-Type: text/event-stream');
header('Cache-Control: no-cache');
header('Connection: keep-alive');
header('X-Accel-Buffering: no');
ob_implicit_flush(true);
class StreamHandler {
publi...