When I’m developing websites, I use a very (very) simple system of creating pages:
//$_page is, of course, declared above the loop, just as $needed_modules is.
foreach ($needed_modules as $part)
{
global $_page;
if (file_exists($part)) {
$_page . file_get_contents($part);
} else {
//404
}
}
echo $_page;
Now, the problem is that file_get_contents doesn’t return anything: not false, not a string, nada (and the file is not empty).
Execution does go inside the if and $part (which corresponds to a filename with relative path) isn’t just set, but it actually points to the file.
Why is it that $_page is empty (as opposed to being set, isset($_page) actually evaluates to TRUE)?
Edit: Error-reporting is on full throttle on my server, and the logs show nothing out of the ordinary.
You’re not doing anything with the returned value. Try this: