Foreach output display, progress issues, experts solve.
$ Citycode = array ("Beijing" => "101010100 ",
"Qingxian" => "101090702 ",
"Cixian" => "101091007 ",
"Chiayi" => "101340901 ",
"Alibaba Cloud" => "101340902 ",
"Yushan" => "101340903 ",
"Xingang" => "101340904"
);
Foreach ($ citycode as $ key => $ value ){
Echo 'output'. $ value .'
';
}
?>
I want to output an array, but there may be a lot of arrays (I want to do some work to generate an array). I want to display one or five arrays slowly. If this is not the case, I have to wait a long time to see the execution result and the execution progress is not displayed.
Reply to discussion (solution)
Add the following statement at the beginning
Ob_start (); // open the output buffer
Ob_end_flush ();
Ob_implicit_flush (1); // output immediately
You can output your output immediately.
The effect is obvious. Thank you for your guidance.