PHP uses the echo syntax to generate empty rows to the output long string.

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.