关于ob_get_clean的疑问

WBOY
Release: 2016-06-23 13:56:36
Original
1609 people have browsed it

<?phpecho "hello word";$out=ob_get_clean();echo $out." everyone";?>
Copy after login

这段程序执行结果是 hello word everyone
奇怪的是为什么可以不用声明 ob_start()


回复讨论(解决方案)

我在网上看到的说法是
ob_start()是打开缓冲区的意思,写不写关系不是很大,这里按照PHP标准的写法添加上去了。

缓冲区默认是打开的
你可用 ob_get_level() 观察到

缓冲区默认是打开的
你可用 ob_get_level() 观察到


原来如此~

你可以看看这个

//ob_start();ob_start();echo 12345;$out1 = ob_get_clean();echo "hello word";$out=ob_get_clean();echo $out.$out1;
Copy after login

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