Re: HTML and PHP output to PHP variable
| From: | php/ml) | Date: | Mon, 12 Jul 2004 09:17:50 +0000 |
| Subject: | Re: HTML and PHP output to PHP variable | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-190228@lists.php.net to get a copy of this message | ||
hello!
use output buffering...
<?php
ob_start();
//... your code here
$_contents = ob_get_contents();
ob_end_clean();
?>
regards,
m.
Maris wrote:
Hi! Let's say my index.php consists of the following: <? include("header.inc"); echo "<p>PHP says Hello World</p>"; ?> <p>HTML says Hello World</p> <? //.. some other php code that generates output... ?> ..some other HMTL output.. My question is: how can I make the whole index.php generated output put in one PHP variable? It is also important that it is done from the same index.php file. Thanks, Maris