Home  >  Article  >  Backend Development  >  Header有没有办法向页面写入title标题

Header有没有办法向页面写入title标题

WBOY
WBOYOriginal
2016-06-23 14:02:032187browse

以下是部分代码,现在打开页面时,页面中有内容,不过页面的title是网址,怎么写入这个标题。

Header("Content-type: application/octet-stream");
Header("Accept-Ranges: bytes");
Header("Accept-Length: ".filesize($pagename));
Header("Content-Disposition: attachment; filename=".iconv("utf-8", "gb2312", $r[title]).".txt");


回复讨论(解决方案)

你这不是文件下载吗?

是文件下载,我看到百度收录的页面中全是网址,没有标题, 所以工想加标题。

加不了标题的 因为title是文件内容

打开一个新的页面下载 把title传到

$title即可

打开一个新的页面下载 把title传到

$title即可

header所做的工作一般是指http协议的header,而不是html文档的header,厘清这个概念吧

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn