title: PHP xls, xlsx, ppt, pptx headers
body: <p>Here is my code where I am trying to send a correct header depedning on a type of a document. I figured out the headers for pdf, doc and docx but I still need to know correct header for Excel and Powerpoint files.</p>
  
  <p>Any help appreciated.</p>
  
  <p>
  
  <pre><code>    $document = urldecode($_GET['document']);
      $extension = end(explode('.', $document));
      $mimeType = '';
      switch ($extension) {
          case 'pdf':
              $mimeType = 'pdf';
              break;
          case 'doc':
              $mimeType = 'msword';
              break;
          case 'docx':
              $mimeType = 'msword';
              break;
          case 'xls':
              $mimeType = '';
              break;
          case 'xlsx':
              $mimeType = '';
              break;
          case 'ppt':
              $mimeType = '';
              break;
          case 'pptx':
              $mimeType = '';
              break;
      }       
      header('Content-type: application/' . $mimeType);
  </code></pre>