Created
March 19, 2015 03:19
-
-
Save boy3vil/c0660f5ff32107918251 to your computer and use it in GitHub Desktop.
PHP include to variable
This file contains hidden or 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 | |
| ob_start(); // turn on output buffering | |
| include('/path/to/include.php'); | |
| $res = ob_get_contents(); // get the contents of the output buffer | |
| ob_end_clean(); // clean (erase) the output buffer and turn off output buffering | |
| ?> | |
| <?php | |
| $res = file_get_contents('http://your_server/path/to/include.php'); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment