note 84380 deleted from function.header by tularis
| From: | tularis@php.net | Date: | Fri, 04 Apr 2014 11:27:15 +0000 |
| Subject: | note 84380 deleted from function.header by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-199155@lists.php.net to get a copy of this message | ||
Note Submitter: Orca8767
----
Note that if you don't want to go through the process of making sure that there is no output
before you send a header, you can use
<?php
ob_start();
?>
at the beginning of your page.
This starts the output buffer, which allows you to send headers whenever you feel like it. Make sure
that you put it at the BEGINNING, after the first php tag.
It allows you to do something like
<?php
ob_start();
echo 'foo';
header("Status: 404 Not Found");
echo 'bar';
?>