PHP uses the echo syntax to generate a blank line to the output long string. Q: What should I do if I use the echo method in php to output long strings to the webpage to generate empty rows? dutyList [2] [newArray (Instructor, 9), newArray (Instructor, deputy director, 10 ), newArray (class teacher, 11), new
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.
Php uses the echo method to output long strings to the webpage to generate empty rows. what should I do? dutyList [2] = [new Array (Instructor, 9), new Array (Instructor, deputy director, 10), new Array (class teacher, 11), new...