Is it possible to require a php file and get all the things that's echo'ed to be returned and stored into a variable?
Example:
//file1.php
// let's say $somevar = "hello world"
<p><?php echo $somevar; ?></p>
//file2.php
$file1 = getEchoed("file1.php");
// I know getEchoed don't exist, but i'm unsure how to do it.