I use a form which purpose is to generate a customized .csv file. Among other things, the user can specify the end of line character.
To do so, he simply enters it in a text area. I have a problem with the backslashed characters, and in particular "\n".
If I don't check the string, the "\n" entered by the user isn't evaluated. It is added to the .csv file as a string, and the outputed CSV has only one line with all the values...: value1\nvalue2\n
instead of :
value 1
value 2
...
So far, I've found a way to deal with it, making the following test :
if ($var == '\n') {
$var = "\n";
}
Is there a more elegant way to solve this problem ?