Created
May 24, 2013 00:54
-
-
Save jaredatch/5640621 to your computer and use it in GitHub Desktop.
Get include() contents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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