As mentioned in PHP Manual:
Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP
Then why does the following code run without any error in localhost? I am using wamp server with PHP version 5.2.5 and Apache version 2.2.6. I am curious to know the reason why I am not getting any error message. Thanks!
<html>
<body>
<div>
some error
</div>
</body>
</html>
<?php
header('Location: http://google.com/');
?>