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