I am trying to get names from the .txt file. I am using the file ('filename.txt') But if I use a php to try and trim the loop, then it comes on several lines:
This is the real line that prints javascript (Note: I will put these names in a select box, if you can solve the problem then the rest of the code should do such work Unless you need to comment on a major problem with it)
& lt ;? For Php ($ i = 1; $ i & lt; 27; $ i ++) {echo "sellbox.point [selbox.options.length] = new option ('". Line [$ i ..] "' , '"$ Lines [$ i]"' '); \ n ". }? & Gt;
How it comes to the browser:
selbox.options [selbox.options.length] = New option ('Djamal ABDOUN', 'First 1 Last 1 '); Selbox.options [selbox.options.length] = New option ('Chadli AMRI', 'First 2 Last 2');
I have to put them in one line so I do not get a canceled string literal JS error, what can I do here?
EDIT: Oh, I should probably mention this, $ lines are started like this: $ lines = file ('filename.txt'); And inside that file, I have formatted like this First1 Last1 First2 Last2 First3 Last3 etc. and I hit Delete after touching the next name after each last name, then hit it to put it on a new line (Editor Notepad ++) Use Use $
trim ($ lines [ $ I])
lines [$ i] since you always break your line at the end of the line line.
Comments
Post a Comment