In my local environment I have many small PHP files in different folders. I use "include" or "require once" to run them together.
I'm going to upload my little project to the web but I only want to upload it as one PHP file. I need to merge the files together.
I found a nice function that makes an include as a string.
function get_include_contents($filename)
{
if (is_file($filename)) {
ob_start();
if(file_exists($filename)) include $filename;
$contents = ob_get_contents();
ob_end_clean();
return $contents;
}
return false;
}
It gives me the HTML result, not the PHP code. I need to get the PHP code.