str_replace()
メールを送信するときにユーザー名を挿入するために使用しようとしています。機能していません。何か不足していますか? 電子メールは処理されますが、変数<!--{Username}-->
に置き換えられません$en['user']
$text_content = file_get_contents('emails/welcome_txt.tpl');
$html_content = file_get_contents('emails/welcome.tpl');
$body = "--$mime_boundary\n";
$body.= "Content-Type: text/plain; charset=\"charset=us-ascii\"\n";
$body.= "Content-Transfer-Encoding: 7bit\n\n";
$body.= str_replace("<!--{Username}-->",$en['user'],$text_content);
$body.= "\n\n";
$body.= "--$mime_boundary\n";
$body.= "Content-Type: text/html; charset=\"UTF-8\"\n";
$body.= "Content-Transfer-Encoding: 7bit\n\n";
$body.= str_replace("<!--{Username}-->",$en['user'],$html_content);
$body.= "\n\n";
$body.= "--$mime_boundary--\n";