How to remove header in PHP below 5.3?

How to remove a header (for example, Last-Modified ) that has already been installed but not yet sent by wire?

(Perhaps it was installed by Apache, "pre" -PHP and something else.)

I am currently using PHP 5.2.17 and header_remove is an undefined function.

To be clear, I do not want to send an empty header line, such as header("Foo-bar:") . I want to completely remove it from the output buffer and send nothing .

+4
source share
2 answers

Use mod_rewrite and change .htaccess

 Header unset Last-Modified 
+2
source

Update your version of PHP or ask your hoster to update it. PHP 5.2 was EOLed a few months ago and therefore will not receive any additional fixes or security fixes. If you are 5.2, you are a security risk to yourself and everyone visiting your site. Updating your version of PHP will additionally give you all the new features and performance improvements.

Also: restructure your logic so that the title is not set first. It is not possible to completely remove the title in 5.2.

0
source

All Articles