foreach - How to pause for-each iterations php beginner -


for reason code not pause in between iterations, expecting pause second between loading thumbnails. doing wrong?

foreach ($media->data $data) {   echo "<img src=\"{$data->images->thumbnail->url}\">";   sleep(1); } 

if expecting generated code reach client-side before terminating script, may have force flush it:

foreach ($media->data $data) {     echo "<img src=\"{$data->images->thumbnail->url}\">";     @ ob_flush();     @ flush();     sleep(1); } 

but stupid, , cause formatting issues in client-side. why don't else , send whole page @ once?

or better client-side control of loaded , in pace, use javascript.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -