faqts : Computers : Programming : Languages : PHP : General Information

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

Entry

How to repeat a chunk of code on command? Can't use while loops. Also, 50+ lines long.

Oct 9th, 2006 10:12
Matthew Wilkinson, Daniel Ross,


Try encasing the code as a function, then you can run it from anywhere
at anytime.
eg.
function YourFunctionName()
{
//Insert code to repeat on command
}
YourFunctionName();
YourFunctionName();