Kaz*_*zar 12
您可以使用输出缓冲区.如果你有一个html页面,例如:
<html>
<head>
<title>Blah</title>
</head>
<body>
Some text here
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
然后,如果你把,放在html文件的顶部:
<?php ob_start(); ?>
Run Code Online (Sandbox Code Playgroud)
在最后一个标签后面的底部,放入:
<?php
$string = ob_get_contents();
//do whatever you need to do to the html, save it to a seperate file, email it, etc
ob_flush();
?>
Run Code Online (Sandbox Code Playgroud)
这基本上意味着$ string变量在动态生成之后将以页面的整个静态html结束.然后,您可以在电子邮件中使用该字符串.虽然实际上,html页面在电子邮件中的工作方式并不完全相同,因此您可能需要重新考虑这种方法.
归档时间: |
|
查看次数: |
10665 次 |
最近记录: |