php页面渲染成Apache服务器中的html [英] php page rendering into html in Apache server

查看:186
本文介绍了php页面渲染成Apache服务器中的html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好......我正在阅读关于apache服务器架构。我们知道浏览器只能理解html数据,所以.jsp,.aspx或.php等页面在服务器端呈现为html,然后才发送给客户端。我只是想知道谁在服务器端将.php页面呈现为html格式。

因为我们知道服务器以数据包的形式向客户端发送数据但我想在发送之前在服务器端发送整个html数据以html格式发送给客户端。

解决方案

要在PHP中捕获渲染输出,必须在页面中使用输出缓冲( http://www.php.net/manual/en/ref.outcontrol.php [ ^ ])

这样的东西:

 <?php  <   br     mode   =  hold     /? >  ob_implicit_flush(); 
?>
//您的其他PHP和HTML代码


buffer = ob_get_flush(); //缓冲区是渲染页面
?>


hi all..i am reading about apache server architecture.As we know that browser only understands html data,so .jsp ,.aspx or .php etc pages are rendered into html at server side and then only sent to client.I just want to know who render the .php page into html format at server side.
as we know that server sends data to client in packets but i want whole rendered html data at server side before it sent to client in html format.

解决方案

To catch rendering output in PHP you must use output buffering in your page (http://www.php.net/manual/en/ref.outcontrol.php[^])
Something like this:

<?php <br mode="hold" /?>  ob_implicit_flush(); 
?> 
// your other PHP and HTML code


buffer = ob_get_flush(); // buffer is the rendered page ?>


这篇关于php页面渲染成Apache服务器中的html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆