【发布时间】:2011-01-26 13:07:08
【问题描述】:
是否可以在一个文档中使用多种标题类型?例如:
header("Content-type: image/jpeg");
header('Content-Type: text/html; charset=utf-8');
将整个页面返回为 text/html... 而
header('Content-Type: text/html; charset=utf-8');
header("Content-type: image/jpeg");
将整个页面作为图像返回.... 如何在同一页面上使用两种类型的内容?我在顶部使用 ob_start(),在开头使用 ob_end_flush()。
【问题讨论】:
-
你为什么要这样做?不可能...
-
我也想这样做,因为在研究 HTTP 标头之前我不了解它们。有一个我觉得有用的 php 例程取决于 header("Content-type: image/jpeg");我想将它纳入其他例程。 Erik 的建议完全适合我。
标签: php header content-type