Jump to content

for and while loops


Ninjakreborn

Recommended Posts

I have been playing with these, I can get the browser to create something over and over again and never stop, like have it say something for eternity, in what possible situations could an infinite while loop end up being effective, i can think of some small samples, but is there a few major samples anyone can give me to understand the effectiveness of these, I heard these also have there purposes in certain situations.
Link to comment
Share on other sites

I am meaning what are the uses of the while loop, and for loop, I know in major programs they can be of great helped, under heavily controlled situations. For instance, in a major forum program, would you ever need an infinite loop to do something specific, if so what, or are infinite loops completely uses on all levels when speaking about php, I know with javascript they are very helpful for instance, if you want scrolling text then you set an infinite loop to allow the text to scroll forever at a timed interval setting, also pictures, you want a gallery that cycles through all pictures in the file, you set an infinite loop, just under a specific guided speed, and with people having the ability to break the loop, by selecting buttons to go on there own pace, so I know it has good uses in javascript, but now what about php, what major purposes are they for.
Link to comment
Share on other sites

well...

infinite loops on a standard page served to a browser will normally time out ater 30s of script parsing (thats the default in the ini file which can be changed - but people don't wait 30 s for a [age anymore!!!!)

you can however use them in cron jobs that run in the background on the server for 'constant' data processing, i.e. stockmarket figures

others will ,I'm sure, give further examples
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.