tags:

views:

103

answers:

1

Does it possible to execute php file and store its output into some variable?

For example i have one global template, then i need to process subtemplates, and afterall i need to insert that subtemplate output into global template block.

How can i do it ?

+2  A: 

You can use the output control functions, buffer the output with ob_start and retrieve it with ob_get_contents:

ob_start();
func();
$output = ob_get_contents();
ob_end_clean();
Gumbo
thank, this is all i need. i just forgot about that buffers feature.