Morty222 Posted October 9, 2008 Share Posted October 9, 2008 I am downloading data into an excel file. \t moves over 1 cell \n starts a new line These work fine. My question is I have 3 lines of data that I want in the same cell, but on different lines. Example: Line 1 Line 2 But all in the same cell. Alt+Enter does it when I work in excel. Anyone know how to write an Alt+Enter? Sample of my output: $line .= $orderID. "\t" . $quantity. "\t" . $message1 . "\n" .$message2. "\n" . $productmail . "\t" . $colormail . "\t" .$sizemail . "\t" .$liconmail . "\t" .$riconmail . "\t" .$ticonmail. "\t" ."\n"; I need $message1 and $message2 in the same cell, but on different lines. Link to comment https://forums.phpfreaks.com/topic/127712-php-csv-help/ Share on other sites More sharing options...
zq29 Posted October 12, 2008 Share Posted October 12, 2008 Enclose your values in double quotes... <?php $line .= "\"$orderID\"\t\"$quantity\"\t\"$message1\n$message2\"\t\"$productmail\"\t\"$colormail\"\t\"$sizemail\"\t\"$liconmail\"\t\"$riconmail\"\t\"$ticonmail\"\n"; ?> Link to comment https://forums.phpfreaks.com/topic/127712-php-csv-help/#findComment-663316 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.