I have an external php file like this:
<!DOCTYPE>
<head>...
...
<body>
<p><?php echo $content;?></p>
..
AND in my code:
$content = 'sample text';
$body = include("layout/mailtemplate.php");
You can see it has php and html code (and pass $content
outside of file to included file)
Is there any way to store content of this file to a php variable? (here content of $body is "1"!)
Also I test
$body = file_get_contents('layout/mailtemplate.php');
It works, but I could not pass $content
to file.
(I know I could pass it via GET) but I have a lot of variables. Is there a simpler way?