Skip to content

Instantly share code, notes, and snippets.

@jaredatch
Created May 24, 2013 00:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredatch/5640621 to your computer and use it in GitHub Desktop.
Save jaredatch/5640621 to your computer and use it in GitHub Desktop.
Get include() contents
<?php
/**
* Get include contents
*
* @since 1.0.0
* @param string $filename
* @return string|bool
*/
function ja_get_include_contents( $filename ) {
if ( is_file( $filename ) ) {
ob_start();
include( $filename );
return ob_get_clean();
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment