Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #6650

Re: Output buffering in included file

From "Peter H. Coffin" <hellsop@ninehells.com>
Newsgroups comp.lang.php
Subject Re: Output buffering in included file
Date 2012-07-24 15:42 -0500
Organization A noiseless patient Spider
Message-ID <slrnk0u267.h39.hellsop@nibelheim.ninehells.com> (permalink)
References <61c7743a-3a40-4465-b8a0-47acb31b6628@googlegroups.com>

Show all headers | View raw


On Tue, 24 Jul 2012 13:07:20 -0700 (PDT), Dani wrote:
> Hello everybody,
> instead of using (e.g. in index.php)
>
><?php
> ob_start();
> include('included-file.php');
> $output = ob_get_clean();
> echo $output;
> ?>
>
> to store the output buffer into a variable, can I use in included-file.php
>
><?php
> ob_start();
> // file content
> ob_end_flush();
> ?>
>
> and in index.php
>
><?php
> ob_start();
> include('included-file.php');
> ?>
>
> ?

Did you try it? Did it work?

-- 
You can lead an idiot to knowledge but you cannot make him think.  You 
can, however, rectally insert the information, printed on stone 
tablets, using a sharpened poker.
              -- Nicolai

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Output buffering in included file Dani <dsdani@live.com> - 2012-07-24 13:07 -0700
  Re: Output buffering in included file "Peter H. Coffin" <hellsop@ninehells.com> - 2012-07-24 15:42 -0500
    Re: Output buffering in included file Dani <dsdani@live.com> - 2012-07-25 02:31 -0700
  Re: Output buffering in included file "J.O. Aho" <user@example.net> - 2012-07-25 07:33 +0200
    Re: Output buffering in included file Dani <dsdani@live.com> - 2012-07-25 02:41 -0700
      Re: Output buffering in included file "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-07-25 12:00 +0200
  Re: Output buffering in included file Kim André Akerø <kimandre@nospambetadome.com> - 2012-07-25 11:56 +0200
  Re: Output buffering in included file Jerry Stuckle <jstucklex@attglobal.net> - 2012-07-25 08:39 -0400
    Re: Output buffering in included file Dani <dsdani@live.com> - 2012-07-25 06:31 -0700
      Re: Output buffering in included file "J.O. Aho" <user@example.net> - 2012-07-25 17:51 +0200
      Re: Output buffering in included file "Peter H. Coffin" <hellsop@ninehells.com> - 2012-07-25 10:43 -0500
        Re: Output buffering in included file Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-07-25 18:44 +0200

csiph-web