Welcome to the Linux community forum and interact with 2 million technical staff. Question: What should I do if the php uses the echo method to output long strings to the webpage to generate blank lines? dutyList [2] [newArray (Instructor-level director, 9), newArray (Deputy Director of teaching quality, 10), newArray (class teacher, 11), newArray (Educational Administration, 12)]; dutyList
Welcome to the Linux community forum and interact with 2 million technical staff> enter the question: in php, the echo method is used to output long strings to the webpage to generate empty rows. What should I do? dutyList [2] = [new Array ("", "9 "), new Array ("Deputy Director of teaching quality", "10"), new Array ("class teacher", "11"), new Array ("Educational Administration", "12")]; dutyList
Welcome to the Linux community forum and interact with 2 million technicians>
Problem:
What should I do if I use the echo method in php to output long strings to a webpage to generate empty rows?
DutyList [2] = [new Array ("", "9"), new Array ("", "10 "), new Array ("class teacher", "11"), new Array ("Educational Administration", "12")];
DutyList [3] = [new Array ("", "1"), new Array ("", "2"), new Array ("consultant ", "3"), new Array ("Network Consulting
Consultant "," 4 "), new Array (" consulting assistant "," 5 "), new Array (" media specialist "," 6 "), new Array ("brand promotion specialist", "7"), new Array ("Regional Director", "8")];
As shown in the code above, I use php to dynamically generate js Code. The short string output is okay. The long string dutyList [3] is output to the page and a blank line is generated, causing js to fail to run, thank you for your advice!
Answer:
It's not an ECHO problem. You have line breaks in your PHP code.
New Array ("Network Consulting
Consultant "," 4 "),
Here there is a line break in it. I usually use ECHO to output the entire webpage without any extra blank lines.