There is a header.php file and it contains some php codes that return HTML. I know I can use require, include to echo the results, but what I want to do is to store its processed output string into a variable.
In a page, I used:
$headerHTML=file_get_contents('header.php');
Then I got the PHP code output rather than the processed HTML output. I know adding http:// would help. But I prefer to keep using relative path, how can I tell the function to treat the php file correctly?
Note: I would like to continue to use this statement file_get_contents
rather than using ob_start()
if possible.