PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
My idea was to display a 404 page to the client (the server should use whatever html page it has for that purpose). The above header does not force this behaviour.
You're artificially implementing that behaviour thus you have to build it yourself. The server doesn't pay attention much to what's being written to the output by PHP.