note 55984 added to function.ob-clean

From: Date: Fri, 19 Aug 2005 16:58:33 +0000
Subject: note 55984 added to function.ob-clean
Groups: php.notes 
Request: Send a blank email to php-notes+get-93911@lists.php.net to get a copy of this message
For some unknown reason, when I had a PHP script that would have this basic structure: <? // include "somefile" // send header info // echo HTML or whatever ?> I would get a blank line at the beginning of my output. Normally, this isn't a problem BUT I had a case where the script was attempting to download a .dxf file and the blank line got included in the downloaded file. I noticed if I simply cut and pasted the contents of the include file instead of the include statement that the blank line disappeared. However, this was not the solution I was looking for. What I ended up doing, was changing the structure to this: <? // include "somefile" ob_clean(); // send header info // echo HTML or whatever ?> which works fine. ---- Manual Page -- http://www.php.net/manual/en/function.ob-clean.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+55984 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55984&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55984&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55984&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55984&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55984&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55984&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+55984&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#93911) next »