title: PHP call function after header for file download is called
body: <p>I have a function creating a file for download like so:</p>
  
  <pre><code>header("Content-type: application/octet-stream");
  header("Content-disposition: filename=file.csv");
  print 'hello hello';
  exit;
  
  $this-&gt;nextFuntion();
  </code></pre>
  
  <p>I need the "nextFunction" to be called after the save dialogue pops up, I've seen various methods around here but they all have to do with header('location:') feature. Basicly the page where the function is called contains the data that goes inside the file. the "nextFunction" will erase the data form the page and return a message etc. </p>
  
  <p>But the best I can do is get the download to work and no function.</p>