function redirect($address){
header("Location: $address");
}
should do it...
PHP is parsed before any output is sent to the browser... Remember, it's server-side. Therefore, you can't collect and send headers after any output is sent to the browser... Once the output is sent to the browser, that's it.
You have to carefully plan, design and implement code that ensures all headers are sent before browser output. It's a limitation within PHP more-so, than with the server itself.