Okay I've found this:
[PHP]
// Enable output buffering
ob_start();
echo date("Y-m-d");
// get the buffer, clear it & return to template
return ob_get_clean();
[/PHP]
but is there a better way?
User Profile
Collapse
-
-
echo as streambuffer
This is what I want to accomplish:
In index.php:
[code=php]
$var = include(“conten t.php”);
echo $var;
[/code]
In content.php:
[code=php]
$outputStream = date("Y-m-d"); //some dynamic text
return $outputStream;
[/code]
but without needing the variable $outputStream, instead I want to be able to write "echo date("Y-m-d");" in content.php....
No activity results to display
Show More
Leave a comment: