I am currently writing to a .csv file in .php
In the following code below, I would like the chip ID's to be within the same cell, but separated by a line break between each value. To my knowledge, surrounding the values you would like with the line breaks in double quotes honors the line breaks while within the same cell. To that effect, I wrote the following with the backslash escape characters.
<?php>
$FirstChipID = "\"" . $_POST["FirstChipID"] . " \n ";
$SecondChipID = $_POST["SecondChipID"] . " \n ";
$ThirdChipID = $_POST["ThirdChipID"] . " \n ";
$FourthChipID = $_POST["FourthChipID"] . "\n ";
$file = fopen( "chipID.csv", "a");
fwrite($file, $FirstChipID . $SecondChipID .
$ThirdChipID . $FourthChipID . "\"" . "\n");
fclose($file);
?>
However, this results in the .csv file creating new rows for each instance of "\n" instead of containing all the values within one cell. I am at a loss as how to approach this and would appreciate some guidance. Where in my logic caused this strange behavior? Am I utilizing something incorrectly? I received the same behavior when combining all chip ID's to a single string with the supposed proper double quotation formatting.