0

I'm sure there's a word that means what I want that would give me the answer if I googled it, but I cannot figure out what the word is.

Suppose I've got a while loop running, and every loop it echoes something.

Suppose the end result is that it runs for ten minutes and then outputs one thousand whatevers. Maybe they all worked perfectly. Maybe they're all an error. I need to wait ten minutes to find out which.

What I'd like, is similar to the command line experience, of the loop runs once, then outputs the result. It runs a second time, adds a second result to the list. And so on.

That way, if the first few loops are all throwing errors, I won't have to wait ten minutes to see what the first error was. I'll just watch the first few errors appear, and get to work.

What's the word for that? And is that experience compatible with PHP technology?

And most importantly: Can anyone link to or provide a code snippet with a while loop that can demonstrate PHP incrementally sending lines to the browser?

  • @AlonEitan I... don't know. I've seen the phrase a lot in my googling. Different explanations of what the word means on the back end. Function lists. But I haven't got a code snippet to work yet, nor have I seen a live demonstration of what it actually looks like when it's working. – Jonathon Philip Chambers May 20 '22 at 04:13
  • It will basically allow you to output from the loop on every iteration, not having to wait for the script to finish executing – Alon Eitan May 20 '22 at 04:15
  • I don't have a live demo thought – Alon Eitan May 20 '22 at 04:17
  • @AlonEitan if you can link to, or create, a code snippet that demonstrates a while loop that outputs to the web browser every iteration, that would indeed be the correct answer to my question. I think I've been searching for one for an hour now, and no luck yet. – Jonathon Philip Chambers May 20 '22 at 04:18
  • Maybe this; https://stackoverflow.com/a/4192086/754119 – Alon Eitan May 20 '22 at 04:21
  • 1
    @AlonEitan ah, that's definitely a duplicate. Thanks. I disagree with the last link proposed as a duplicate, but I concede that this one definitely is. Good job. – Jonathon Philip Chambers May 20 '22 at 04:24

0 Answers0