php - 从 php 控制器将 html 文件呈现为 html
问题描述
更新:
有人可以解释为什么第一种方法显示为纯文本,而第二种方法显示为 html?我正在尝试将文件内容显示为 html。
<?php
echo getcwd() . '<br>';
方法一
$body = file_get_contents('wp-content/themes/twentytwelve-child/views/html/email-footer.html');
echo $body;
方法二
$body = '<!DOCTYPE html> <html>
<head>
<style>
div{
font-size:5vw!important;
}
#img1{
width:100%!important;
}
</style>
</head>
<body lang=EN-US>
<div style="text-align:center;margin:0 auto;font-size:16px">
<!-- <img id="img1" style="width:70%;" src="cid:swag-logo">-->
<p> Hi, <br><br> Thank you for your interest in Sustainable Weston
Action Group. If you would like to sign up for our quarterly
newsletter or have specific areas of interest/expertise that you
would like to share,please complete
<a href=" https://www.sustainablewestonma.org/get-involved/" >our
Get Involved form</a> This information is for Sustainable Weston
Action Group use only - we will not share your information with any
other parties.<br><br><br>Sustainable Weston Action Group</p>
</div>
</body>
</html>';
echo $body;
?>
解决方案
推荐阅读
- java - 有没有办法通过 Azure 存储中的帐户控制杆获取存储帐户层(热或冷)?
- python - 从位于网站的图表中解析表格项目时遇到问题
- polymer - lit-element 中的装饰查询是什么?
- flutter - Flutter Provider - ChangeNotifierProxyProvider 设置依赖
- node.js - Prisma:获取“com.prisma.deploy.schema.InvalidProjectId:没有名称为“默认”和阶段“默认”的服务”错误
- typescript - 仅在默认显式调用时才调用 Jest mock
- c# - 将数字签名字段添加到 PDF
- ios - 如何在自定义滚动偏移处而不是在 UITableView 的顶部折叠带有大标题的导航栏?
- python - 如何解决包含(0、6)数组的numpy数组求和过程中的广播错误?
- angular - ionic 4 以 Html 显示数据存储