Again thankyou hostfreak. But you had changed my function calling from loop(10) to loop(10, "Please answer me"). First i don't like to have another parameter (your 2[sup]nd[/sup] parameter). And i would like to execute any statements inside the calling loop function. Example 1: [code] loop(10) { ////MySQL insert statements. } [/code] Example 2: [code] loop(10) { ////Some simple echo statemets. } [/code] Example 2: [code] loop(10) { ////Some file manupulations. } [/code] Sorry if i have hurted any body.. Please reply me. [quote author=hostfreak link=topic=107212.msg429820#msg429820 date=1157632212] With my function, you can change what is looped and how many times, for example: [code] <?php function loop($times, $text) { for ($i = 0; $i < $times; $i++) { echo "$text<br />"; } } loop(10, "Please answer me"); //Please answer me - looped 10 times loop(8, "Hello, how are you"); //Hello, how are you - looped 8 times //You could apply statements like: $test = "8"; if ($test == "8") { loop(5, "Test equals 8"); } ?> [/code] [/quote]