printing a new line in a csv file cell

Khaleel picture Khaleel · Jul 3, 2013 · Viewed 51.3k times · Source

I am generating an CSV file in php. I need to print the text in new line inside a cell(I can do this in excel using Ctrl+Enter or Alt+Enter). For that I tried using '\n', '\r', but nothing helped. How can I achieve this?

I am using yii extension ECSVExport to generate csv.

I want an output like this:

ID  Value
1   A
    B
2   C
3   E
    FF
    G
4   X

Answer

Samy Massoud picture Samy Massoud · Jul 3, 2013

Try this

"\n"

inside double quote