rxbanditboy1112 Posted February 8, 2008 Share Posted February 8, 2008 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'].""; Link to comment https://forums.phpfreaks.com/topic/90133-how-to-groups-things-between-commas-in-csv-files/ Share on other sites More sharing options...
schilly Posted February 8, 2008 Share Posted February 8, 2008 try tab separated? \t Link to comment https://forums.phpfreaks.com/topic/90133-how-to-groups-things-between-commas-in-csv-files/#findComment-462219 Share on other sites More sharing options...
phpSensei Posted February 8, 2008 Share Posted February 8, 2008 Use Pipes "|" instead. Link to comment https://forums.phpfreaks.com/topic/90133-how-to-groups-things-between-commas-in-csv-files/#findComment-462224 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.