PHP uses echo syntax to produce blank lines for output long strings _php Tutorial

Source: Internet
Author: User
Questions:

How to generate empty lines in PHP using the Echo method to output long strings to a Web page?

Dutylist[2]=[new Array ("Teaching director", "9"), new Array ("deputy director of Teaching", "ten"), New Array ("Class teacher", "one"), new Array ("Academic", "12")];
Dutylist[3]=[new Array ("Admissions office Director", "1"), new Array ("Associate director of Admissions Office", "2"), new Array ("Consultant", "3"), new Array ("Network advisory

Consultant "," 4 "), New Array (" Consulting assistant "," 5 "), new Array (" Media Specialist "," 6 "), new Array (" Brand communications Specialist "," 7 "), new Array (" Regional supervisor "," 8 ")];
As shown in the above code, I use PHP dynamic generation of JS code, short string Output no problem, long string dutylist[3] output to the page produced a blank line caused JS can not run, please the Colonel Advice Ah!

Answer:

Not the echo question, you have a line break in your PHP code itself.
The new Array ("Network Advisory

Consultant "," 4 "),
Here itself there is a newline character inside. I normally use echo to output the entire page without any extra blank lines.

http://www.bkjia.com/PHPjc/364592.html www.bkjia.com true http://www.bkjia.com/PHPjc/364592.html techarticle question: How to generate blank lines in PHP using the Echo method to output long strings to a Web page What do you do? Dutylist[2]=[new Array (teaching Director, 9), new Array (Deputy director of Education, Ten), new Array (head teacher, one), new ...

  • 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.