title: Wordpress excel download from plugin
body: <p>I am making a wordpress plugin that collects information from the user and then presents it in an admin screen in a table. I would like to also be able to download this table to excel. I know how to do a basic download to excel file in PHP with this code:</p>
  
  <pre><code>header("Content-Disposition: attachment; filename=\"$filename\"");
  header("Content-Type: application/vnd.ms-excel");
  </code></pre>
  
  <p>which then converts all of the page output to an excel file. </p>
  
  <p>But in this case, I need to also be able to use wordpress functions like get_option(), which I can't use in just a straight called php file. But if I make it a wordpress admin page, the admin skin gets included in my file. </p>
  
  <p>Anyone know how to do an excel download from the wordpress admin screen that includes info from wordpress functions like get_option?</p>