I want to make a website write a message every second.
<?php echo '111';?>
How can do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want the user to see a message every second in their browser, this isn’t doable in PHP. PHP is a server-side language, meaning that by the time the page reaches the browser, PHP’s work is done.
You’ll need a client-side language such as Javascript to accomplish this, using something like setTimeout: http://www.w3schools.com/jsref/met_win_settimeout.asp
Edit after OP’s clarification:
If instead what you want is to execute the script once every X seconds, then you should look into cron. You can use cron to schedule your script to run as often as you desire.
So an example of how it might work is: