title: PHP export to CSV & open in excel without having to use text import wizard
body: <p>This is kind of silly and unecessary but also kind of a waste of time since I am doing this every day. But I am wondering if there is a way to export data using PHP to CSV that does not require the use of the text import wizard when opening the file in excel.</p>
  
  <p>Currently my code looks like this which I think seems to be pretty standard every where I look:</p>
  
  <pre><code>header("Content-type: text/csv");
  header('Content-Disposition: attachment;  filename=exported_shipments_'.date("Ymd").'.csv');
  header("Pragma: no-cache");
  header("Expires: 0");
  
  echo "name" . "\t";
  echo "address_1" . "\t";
  echo "address_2" . "\t";
  echo "city" . "\t";
  echo "province_code" . "\t";
  echo "postal_code" . "\t";
  echo "country_code" . "\t";
  echo "phone" . "\t";
  echo "package_contents" . "\t";
  echo "description" . "\t";
  echo "value" . "\t";
  echo "value_currency" . "\t";
  echo "order_store" . "\t";
  echo "order_id" . "\t";
  echo "package_type" . "\t";
  echo "size_x" . "\t";
  echo "size_y" . "\t";
  echo "size_z" . "\t";
  echo "size_unit" . "\t";
  echo "weight" . "\t";
  echo "weight_unit" . "\t";
  echo "postage_type" . "\t";
  echo "signature_requested" . "\t";
  echo "insurance_requested" . "\t";
  echo "ship_date" . "\t";
  echo "\n";
  </code></pre>
  
  <p>And so on. </p>
  
  <p>Is there anything I can do so that excel recognizes that I want it to be delimited right away instead of having to use the wizard?</p>