Reputation: 2285
In PHP a common error is (Header already sent) and it's reason is an space and error detection in this case is difficult. Is there any code to delete all of header that previous sent? If exist a code or function it would be very very usefull.
Upvotes: 1
Views: 276
Reputation: 24551
No. "Sent" means "sent to the client". You cannot tell those TCP packages to come back once they leave your server.
Follow the IPO principle (Input-Processing-Output) and you will not have these problems.
This means, the flow of your PHP code should always be like:
Upvotes: 2
Reputation: 75629
No. What is sent cannot be "un-send". Fix your code to not trigger unintended header flush (the simplest approach we be stop using "?>" at the end of scripts). Also you can enable output buffering: http://php.net/manual/en/book.outcontrol.php
Upvotes: 2