I’m trying to define a string as a combination of hard coded characters and of the contents of another file. What I have tried is this.
$html = "<h1>
".file_get_contents("file.php", TRUE)."
<h1>";
The problem is that only raw text is being returned from file.php. Whatever it is that PHP is supposed to echo isn’t being echoed..
You need output buffering to do that:
See also:
ob_start()ob_get_clean()