For long I always thought that header function will only work when there is nothing rendered before the header call.
But recently I discovered(ofcorse with help of google) that we can render anything before the header call and still redirect the page.
Normal Usage with error is
echo "This will give error"
echo "This will NOT give error";
Here refresh:0 means the page will load after 0 seconds(which is instantly).
Basically this can be used when we want to have delay the page loading say we want to load yahoo after 2 seconds.
In this case the code will be
So start using this header call and redirect the page anytime during page execution.