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

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -