You are here: A general buffering function « PHP Programming Language « IT news, forums, messages
A general buffering function

Posted by Razzbar on 04/23/07 20:16

I've been trying to write a general buffer function that looks
something like this:

function buffer($arg){
ob_start();
$arg;
return ob_get_clean();
}

Note that the intention is for this to be used with functions that
produce output.

If $arg is a function like,

function a(){ echo "this is a"; }

and passed to the buffer function, it will be evaluated (pass by
value) and echo its output. I'd like to supress the output. Passing by
reference like .... buffer(&$arg) .... still causes an evaluation of
the function, and output being spit out.

Is there a way functions which produce output can be passed to another
function without being evaluated and emitting output?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация