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.
For example.
This code uses output buffering to obtain the file's content:
ob_start();
include('foo/bar.tpl');
$output .= ob_get_contents();
ob_end_clean();
This code uses file_get_contents and gets the same results.
$output = file_get_contents('foo/bar.tpl');