1
PHP的echo是否等待将数据发送到屏幕,直到脚本的其余部分完成?PHP echo等待脚本的其余部分
所以,如果我有:
<?
echo "Hello World";
$xmlData = file_get_cotents("www.webpage.com");
$myFile = "data_backup.xml";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $xmlData;
fwrite($fh, $stringData);
fclose($fh);
?>
如此做上面的示例如何显示的Hello World,直到从URL的内容retrived和本地保存?
因此,使用flush如何确保我的“Hello World”在进程的其余部分运行时发送? – Denoteone
@Denoteone它应该 – Neal
感谢信息+1,但我仍然看到输出延迟,直到脚本完成。不确定是否有其他选择? – Denoteone