On Dec 13, 2007 6:08 PM, bigballball007 <[EMAIL PROTECTED]> wrote: > > > When I inculde "xxx.php" , the php process this file and echo the HTML > result back to the client browser to display .How can I make the php > to store the result HTML code to a variable instead of echo to the > bowser? Are there any built in php function to do it? > > Thanks and regards >
When I do things like that I tend to use output buffering (see http://php.net/manual/en/function.ob-start.php), this means that the include files do not need to do anything special and can keep echoing as much as they like. Something like the following... ob_start(); include 'xxx.php'; $html = ob_get_clean(); Regards, Phill
