Home > Backend Development > PHP Tutorial > 请问一个关于include的有关问题

请问一个关于include的有关问题

WBOY
Release: 2016-06-13 11:23:27
Original
844 people have browsed it

请教一个关于include的问题
比如,我有一个common.php文件,里面内容是
if(extension_loaded('zlib')){ob_start('ob_gzhandler');}

if(extension_loaded('zlib')){ob_end_flush();}
?>

这个是开启zlib的一段代码,第一句是开启,最后一句是结束,我想把他插入到index.php里,因为index.php里还有一些代码,如何能自动将第一句插入到页首,最后一句插入到页尾,这个用include可以吗,具体操作是什么,谢谢。


------解决方案--------------------
分两个文件,把初始化的部分放入header,最后输出放入footer。

分别在第一行和最后include
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template