There is an easy way to get a file’s content into a variable:
$var = file_get_contents($_SERVER[‘DOCUMENT_ROOT’].’/file.php’);
Useful when building a variable that holds output (HTML) and adding an included file to the output string.
There is an easy way to get a file’s content into a variable:
$var = file_get_contents($_SERVER[‘DOCUMENT_ROOT’].’/file.php’);
Useful when building a variable that holds output (HTML) and adding an included file to the output string.