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

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

Related Article

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.