ob_start();
for($i=1; $i<=10; $i++){
echo 'FUU';
$output = ob_get_contents();
}
echo $output;
ob_end_flush();
So instead of one FUU I get 10! Why does my ob_start() not work?
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.
I don’t think you get what it’s doing. Here’s a walk through:
When you call
ob_get_contentseach iteration, it’s getting everything that has beenechoed.