I want to require/include a file and retrieve its contents into a variable.
test.php
require/include does not return the contents of the file. You'll have to make separate calls to achieve what you're trying to do.
EDIT
Using echo
will not let you do what you want. But returning the contents of the file will get the job done as stated in the manual - http://www.php.net/manual/en/function.include.php