Can you provide proper examples please. Posting
////MySQL insert statements.
////Some simple echo statemets.
////Some file manupulations.
Doesnt help much.
A good example will be to post the code you want to be repeated over and over in your loop function.
If you dont want a secound paramter, then prehaps use global:
for ($i = 0; $i < $times; $i++)
echo "$text<br />";
$text = "Please answer me";
loop(10); //Please answer me - looped 10 times
$text = "Hello, how are you";
loop(8); //Hello, how are you - looped 8 times
Also you cannot use a function to do three different things, without having more than 1 parameter. How will the loop function know you want to run a query, or manupulate a file, echo something etc. I cannot see where you are going with this.