Is it possible to display string on the browser while in infinite loop? This is what I want to happen:
while(1) {
echo "should display these lines on browser while in infinite loop.<br>";
}
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.
Yes, it is possible. You need to flush the output to the browser if you want it to appear immediately:
Chances are that whatever you’re trying to accomplish, this isn’t how you should go about it.
PHP will eventually time-out, but not before it generates a massive HTML document that your browser will have trouble displaying.