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
Post a Comment