I have a txt file on the server that contains 10 lines of text. Sometimes the text file is overwritten and I get new lines using "\ r \ n". My problem shows when I want to load strings in javascript variables. I do it this way, but it only works for numbers or for the last line of the file, because it s not using the breakline tag: var x = '<?php echo $file[0]; ?>';
Ive tried to warn (x), but it doesn’t work ... (only works if I read the Last line) Any ideal?
source
share