ZachMEdwards Posted August 25, 2010 Share Posted August 25, 2010 Hey guys! I found a flush function and it seems to be working well, but sometimes it will cut off characters. It's very strange. Here's my flush function: function out($str) { echo $str."<br />\n"; vbflush(); } function vbflush() { if (ob_get_length()){ @ob_flush(); @flush(); @ob_end_flush(); } @ob_start(); } And I'm calling it like this: out('Waiting 30 seconds until execution'); And this is my output: Waiting 30 seconds until executio Anyone know why? Quote Link to comment Share on other sites More sharing options...
nethnet Posted August 25, 2010 Share Posted August 25, 2010 That's very strange indeed. I've copied that code exactly and saved it to my server, and the output is as expected. See it here.. I wonder if it has anything to do with the line feed at the end of the string? It seems that only the final letter 'n' is cut off, so perhaps there is something with the '\n' that is causing it? This shouldn't be the case, but I can't see what else would even possibly cause that. Does it still do it if you remove the line feed? And what about changing the single quotes to double quotes when you call the out() function? Try changing your parameter to a string that ends in a letter other than n. Whatever the case, it seems to be exclusive to your server, so you must have a setting somewhere that is causing it. Also, is it cutting off the <br /> tag as well? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.