I am using a PHP include function to add content to an email sent out. Problem is I don't want to echo the file too, I only want to include it as the $message.
Whats the equivalent of include that returns the string without the echo.
$message = include('email/head.php');
Use output buffering.
ob_start();
include('email/head.php');
$message = ob_get_contents();
ob_end_clean();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With