I've got this line of text I'm trying to append to a text file using the below code.
HTML Code:$TextToAdd = "<li>SDG gave a Lighten alert.</li><li>CPB gave a Pyramid alert.</li><li>OKN gave a Pyramid alert.</li><li>SHR gave a Lighten alert.</li><li>TRU gave a Pyramid alert.</li><li>BEN gave a Buy alert.</li><li>NAB gave a Sell alert.</li>";However, when I open the file the text has been split up over several lines and looks like this??PHP Code:$linebreak = "\r\n";
//name of file to add info
$filename = "test file.txt";
//Open file for append
$open_file = fopen($filename, 'a');
//add to file
fwrite($open_file, $TextToAdd);
//add line break
fwrite($open_file, $linebreak);
//Close file
fclose($open_file);
![]()
Why is this happening and how can I ensure the text is displayed on 1 line of the text file?HTML Code:<li>SDG gave a Lighten alert.</li><li>CPB gave a Pyramid alert.</li><li>OKN gave a Pyramid alert.</li><li>SHR gave a Lighten alert.</li><li>TRU gave a Pyramid alert.</li><li>BEN gave a Buy alert.</li><li>NAB gave a Sell alert.</li>


Reply With Quote
...... when I was reading the signal type (Pyramid, Lighten ec...) each had a line break after it so that is why in my output text file there was a line break after each signal.....Thanks.
