【问题标题】:How to add content to an http request?如何向 http 请求添加内容?
【发布时间】:2010-09-04 01:59:52
【问题描述】:

我有以下:

$request="HTTP/1.0 200 OK
Date: Sat, 04 Sep 2010 00:37:36 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=UTF-8
Server: gws
X-XSS-Protection: 1; mode=block
X-Cache: MISS from proxy.rstel.net
X-Cache-Lookup: MISS from proxy.rstel.net:3128
Via: 1.0 proxy.rstel.net (squid/3.0.STABLE15)
Proxy-Connection: close

<html>
<body>
Blah Blah Blah
</body>
</html>"

$response=addhtml("Hello world!",$response);

如何在&lt;html&gt; 上方添加自定义html?我想要一个基于空行间隙的解决方案!

谢谢

【问题讨论】:

    标签: php html http header


    【解决方案1】:

    在zend框架中有一些类似的东西

    $this->getResponse()
                 ->appendBody("Hello World\n")
    

    我想知道为什么你有两次 Hello World。使用 addhtml 您想添加自定义文本以响应或追加。

    【讨论】:

      猜你喜欢
      • 2016-01-01
      • 2017-02-05
      • 2012-06-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多