This is an example available at the php’s manual. I am posting this here for later reference.
This function gets the file’s content – instead of just including it.
function get_include_contents($filename) { if (is_file($filename)) { ob_start(); include $filename; return ob_get_clean(); } return false; }
2 thoughts on “[PHP] Get file contents instead of including it”