December 9, 200520 yr Hi guys.Basicly, I want the file to go to the very first line after it is "Done". If its not possible to go to the first line, calling a XPTO.php file would also work. This way I would call the same file (the one that is running) and the effect would be the same as going to the first line.Any help? I suck at programming!Let me know if I didn't explain myself too well.
December 9, 200520 yr Not sure if this would work, I've been in java and not php recently (AP Comp Sci). But could this all go into a function in the php file, and then make a recursive call at the end? (recursive call means that the function will call it self again, thus the "reptition")
December 29, 200520 yr I don't know Make a function called something and then call it at the end of the script againfunction hello() {//THE THING YOU WANT TO LOOP echo "<p>Hey how are you doing?!"; echo "<br />What is your name</p>";hello();}hello(); Edited December 29, 200520 yr by spinFIRE
December 29, 200520 yr Why not just use a loop?for( $i = 0; $i < 100; $i++ ) {// Do what you want in here...}So $i is set to 0, and is incremented each time it runs until $i = 99, since it'll stop when $i can no longer be less than 100.
December 29, 200520 yr or make a copy of the script and include it at the end like so:file.php-------file2.php| xxxxxxxxxxx || xxxxxxxxxxx |file2.php-----file.php
December 29, 200520 yr very last line do a require file.php;You may want SOME sort of conditional for that or it will endlessly keep including the php file
January 7, 200620 yr Author very last line do a require file.php;You may want SOME sort of conditional for that or it will endlessly keep including the php fileWorked extremly well!
January 29, 200620 yr The other way to get the same effet would be to use a while loop and then use ob_flush() to output the stuff at the end continuosly.What do you want to use this for?
Create an account or sign in to comment