What are the differences between these two ways of obtaining file contents? Which one is better and more efficient? I think they both obtain the same results but I really don't know which method is better.
This code uses output buffering to obtain the file's content:
$output .= ob_get_contents();
$output = file_get_contents('foo/bar.tpl');
Well, the second example will just output the file content as raw text, while in the first the file content will be parsed by the
PHP interpreter, meaning if some
PHP code exists within it, it will be executed!