PHP URL 跳转

function redirect($url) {
  if (!headers_sent())
    header('Location: ' . $url);
  else {
    echo '';
    echo '';
  }
}

redirect('http://www.google.com');