php - Capture STDOUT from included file to variable -


How to capture all the things that include a file in a variable or another file

Output buffering is the way to go.

  & lt ;? Php ob_start (); // start buffering output in '/ path / to / file /'; $ MyVariable = ob_get_clean (); // buffered output // to $ my $ varianable and clear // output buffer   



Comments