i want create email templates website.
my template
so let's template_header.php
:
<html> <head> <title> '.$email_subject.' </title> </head> <body>
and template_footer.php
:
</body> </html>
the problem
as know can use output buffering include these templates. code:
<?php ob_start(); include "template_header.php"; ?> <p>text</p> <?php include "template_footer.php"; $message = ob_get_contents(); ob_end_clean(); ?>
but doesn't work! $message
empty! when var_export($message)
, don't anything!!! not empty string.
- so problem code?
- what other ways can include text?
this works me.
ob_start(); //print things - , mean print. echoing , plain html work. $message = ob_get_clean(); echo $message;
Comments
Post a Comment