(Grrr I despise PHP's use of the underscore. I so prefer it to be timeSleepUntil() like how they're set up in my native script, JavaScript.)
Say I have this code:
What I want this to do is load the page and display "Loaded", then one second later display "1 second" and so on. But instead it appears to delay the loading of the entire page and then displays them all at once. The effect I am desiring is similar to using setTimeout() in JavaScript, except the processing is done server side. Am I correct in assuming that I would have to use Ajax in this case? Also, I want the script to commence the time_sleep_until()'s after the page has been loaded. Finally, my third queston is: if I call a time_sleep_until() and then leave that page, will the time_sleep_until() command continue to delay until that time?
Sorry, I understand this post is anything but logical.
Say I have this code:
Code:
<html>
<head>
<title>time_sleep_until</title>
</head>
<body>
<?php
echo "Loaded";
time_sleep_until(time()+1);
echo "1 second";
time_sleep_until(time()+1);
echo "2 seconds";
time_sleep_until(time()+3);
echo "Woke up";
?>
</body>
</html>
Sorry, I understand this post is anything but logical.