"Online Help" about PHP timer issues
Novice Help About PHP timer issues:
I want to write a timer on PHP, but PHP does not seem to support this feature, on the Internet to check a lot of friends, but none of the methods,
I now want to through a dead loop to achieve, but also not, to help my eldest brother elder sister ...
Ignore_user_abort (TRUE);
function Test () {
echo "Test Timer! ";
}
do{
Sleep (3);//
Test ();
?>
PHP
------Solution--------------------
What do you want to do?
------Solution--------------------
jquery delay bar, combined with Ajax.
------Solution--------------------
crontab/Scheduled Tasks
------Solution--------------------
References:
Novice Help About PHP timer issues:
I want to write a timer on PHP, but PHP does not seem to support this feature, on the Internet to check a lot of friends, but none of the methods,
I now want to through a dead loop to achieve, but also not, to help my eldest brother elder sister ...
PHP code?123456789101112
In fact your method is feasible value is not should use echo to express because PHP in the process of running the echo information is stored in the buffer before the program runs out and will not output so you do not see the effect
You can replace echo with a database operation statement, such as 5 seconds to add 1 data. Can you look at it again?
------Solution--------------------
And it's best not to add ignore_user_abort to the test. This will run in the background even though the browser will still continue to execute unless stopped from the process
------Solution--------------------
When the page is closed, the time will not be updated.
For example, if you have a 1-minute visit, a user with a time difference of more than 1 minutes from the current time is naturally not online.
------Solution--------------------
You can use Window.setinterval () and Ajax to constantly send data to a PHP file, or to request data.
------Solution--------------------
You can use recursive functions to implement this function.