Output Control 函数可以让你自由控制脚本中数据的输出。它非常地有用,特别是对于:当你想在数据已经输出后,再输出文件头的情况。输出控制函数不对使用 header() 或 setcookie(), 发送的文件头信息产生影响,只对那些类似于 echo() 和 PHP 代码的数据块有作用。
我们先举一个简单的例子,让大家对Output Control有一个大致的印象:
\n
\n
我们先举一个简单的例子,让大家对Output Control有一个大致的印象:
\n
\n
代码片段\n
热门分类
推荐阅读
- PHP Composer报错Your requirements could not be resolved to an installable set of versions的排查方法(composer why-not定位冲突、平台约束与版本约束调整)
- PHP连接MySQL报错SQLSTATE[HY000] [2002] No such file or directory与Connection refused的排查方法(localhost与127.0.0.1区别、socket路径与3306端口定位)
- PHP报错Allowed memory size of 134217728 bytes exhausted的解决方法(memory_limit调整、memory_get_usage定位与内存泄漏排查)
- PHP-FPM日志报server reached pm.max_children setting的排查与解决方法(pm.max_children计算与slowlog定位慢请求)
- PHP上传大文件失败返回413或$_FILES为空的解决方法(upload_max_filesize与nginx client_max_body_size配置)