Eval A File

Description: Evaluate an external file as a PHP script and get the result as string. For example, you’d like to get the contents (and all PHP output) of a (text|XML|HTML) file after having processed whatever PHP inclusion it may contain, to further process these contents.

$str = compile('file_to_process');
$str = do_more_things_with($str);
ECHO $str;
FUNCTION compile($file) {
    REQUIRE $file;

Enjoyed this post? Share it!


Leave a comment

Your email address will not be published.