What does it mean to write like this? Solutions

Source: Internet
Author: User
What does it mean to write like this?

The above code is written in the HTML file, I would like to ask


This code above a EOT should have the corresponding beginning section above. The following line if ($ifmagic && $read [lou]==0) {Print < <
------Solution--------------------
Does your file have an include or require other file?
------Solution--------------------
Heredoc technology, usually not detailed in regular PHP documentation and technical books, just mentions that this is a Perl-style string output technique. But now some of the forum procedures, and some of the article system, are clever use of heredoc technology, to partially realize the interface and code of the quasi-separation.

In the PHP documentation, just mention echo can output a multiline string with the following command (and the variables are automatically replaced):
PHP code
Copy the code code as follows:

Echo << <>
This uses the ' Here Document ' syntax to output
Multiple lines with $variable interpolation. Note
The here document Terminator must appear on a
Line with just a semicolon. No extra whitespace!
END;

The end terminator above can be set by itself, using "EOT" to finish. However, it is important to note that this end must be at the beginning of a line to be valid, which is a limitation of Heredoc technology (because Heredoc can customize the terminator, so this problem is introduced).
In order for the content of Heredoc to be recognized correctly by an editor such as Dreamweaver in order to achieve the "WYSIWYG" web design, you need to add comments to the Heredoc, as shown in the following example file:

PHP code
Copy the code code as follows:





<title>Untitled Document</title>



Hello, $name!





Such a template file, in fact, is a standard, can execute PHP files. However, this PHP file, whose HTML style is displayed correctly in Dreamweaver, will be treated as HTML annotations and will not be output when output. For example, the above file in Dreamweaver is displayed as:
PHP code
Copy the code code as follows:

Hello, $name!

In this way, in the design of the page, we can use the visual interface of DW, some of the interface modification, landscaping and other work. While there is no complete separation of code and HTML, at least a complementary design approach is provided.


In this way, in the design of the page, we can use the visual interface of DW, some of the interface modification, landscaping and other work. While there is no complete separation of code and HTML, at least a complementary design approach is provided.
  • 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.