Executing a function after the previous function has finished running <p>I have a function <code>my_function()</code> which I need to run 10 times. Right now all 10 functions are running at the same time (asynchronously?). How can the next execution of the function occur after the previous one has finished?</p> <p><em><code>my_function</code> contains <code>CURL</code> calls and reading/writing to database tables. I wonder if any of these are running asynchronously</em></p> <pre><code>$repetitions = 10; for($i = 0; $i &lt; $repetitions; $i++) { my_function($param); } </code></pre>