Good afternoon dear friends. The other day there was a problem with ob_end_flush() , it stopped working. I can not find out the reason. The code is as follows.

 if(ob_end_flush()){ ob_start(); curl запрос на сайт и прочие фильтры $data = ob_get_content(); } flush(); 

Put else also did not give the result in the case of false. and when I remove if(ob_end_flush()){ } flush(); then everything works. But the only thing is that the result displays but not as it should;

  • and what is the meaning of if (ob_end_flush ()) {? - vitidev
  • This function will send the contents of the output buffer (if available) and disable this output buffering. - Alex Mixayelovich Sokolov
  • site on codeinterger .. without ob_end_flush header gets to the end of the site below foother, with ob_end_flush it stands on top .. Why is it so I can not understand .. But I know one thing that ob_end_flush fixes it .. Everything was ok until today .. today this ob_end_flush is dead, I can’t find the reason, even I deleted everything with ob_start (); and put a simple echo, but did not work (( - Alex Mixayelovich Sokolov

1 answer 1

As written in the comments - the site on the codeinterger framework. Frameworks often use the nested ob scheme. Read http://php.net/manual/ru/function.ob-start.php

Output buffers are pushed onto the stack, i.e. ob_start () can be called after calling another active ob_start (). It is necessary to call ob_end_flush () the appropriate number of times.

Try calling ob_end_flush() several times - 5 times for faithfulness :)

  • Thank you so much, it worked !!!!!!!!!! - Alex Mixayelovich Sokolov