2010-09-04 58 views
1

我有以下几点:如何添加内容到一个http请求?

$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); 

如何添加<html>右侧上方有一个自定义的HTML?我想要一个基于空行差距的解决方案!

感谢

回答

0

Zend框架有一些类似的东西

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

我不知道为什么你的Hello World的2倍。使用addhtml,您想要将自定义文本添加到响应或追加。

+0

Zend对我来说并不可靠,但无论如何谢谢 – Ryan 2010-09-04 02:10:11