PHP: sleep() for particular line of code
is it possible to use sleep() (or some other function) to wait before execution? I have for example: <div>bla bla</div> <?php $a echo $a; ?> some divs and html <?php $b echo $b; ?> How to execute the first php script say 5 sec after the page has loaded but to show everything else as the page loads? If I use sleep() before the first php it will delay the whole page from loading. You want to use AJAX for this. Example using jQuery: <div id="content"> <-- You want to load something here after 5 seconds --> </div> <script type="text/javascript"> setTimeout(function() { $('#content').load("/url/to