Jump to content

how to groups things between commas in .csv files


rxbanditboy1112

Recommended Posts

So i made a .csv file download with php.

 

It works well, my only worry is that if I have entries with comma's in them something will go wrong. I heard double quotes work to group things together; however, when I open the file in excel, the double quotes appear with the entries. This is how i generate each line:

$line = "$orderIdNumber, ".$row['customer_id'].", ".$row['order_date'].", \" ".str_replace('"', '""', $row['buyer_name'])." \", \" ".str_replace('"', '""', $row['buyer_address'])." \",".$row['order_qty'].",\" ".str_replace('"', '""', $row['paypal_transaction_id'])." \",".$row['event_host_fee'].", ".$row['verified']."";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.