Warning: Cannot modify header information
1. 修改php.ini找到php.ini
output_buffering = On
output_buffering默认为off的。改成On或者4096
2. 用于header()之前
<?php
ob_start(); //打开缓冲区
echo "hello"; //输出
header("location:index.php"); //把浏览器重定向到index.php
ob_end_flush();//输出全部内容到浏览器
?>
查看完整版本: Warning: Cannot modify header information
Tags: