📜  php 邮件模板 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:26.230000             🧑  作者: Mango

代码示例2
$variables = array();

$variables['name'] = "Robert";
$variables['age'] = "30";

$template = file_get_contents("template.html");

foreach($variables as $key => $value)
{
    $template = str_replace('{{ '.$key.' }}', $value, $template);
}

echo $template;