PHP Understanding Print EoT delimiter and echo eot usage difference Summary _php tutorial

Source: Internet
Author: User
Tags tag name
In HTML and PHP writing, echo can output multiple strings at the same time, without the need for parentheses.
Print can only output one string at a time, requiring parentheses.
Print is used in a very similar way to the C language, so there is a special explanation for the% in the output content.
ECHO has no return value, print () has a return value, and returns Flase when its execution fails, such as a broken wire.
Echo can have multiple parameters, print one parameter. Recommended with Echo.

See the example below to see the print << in PHP Copy CodeThe code is as follows:
Print <<


$value;

...


EOT;

Meaning:
The <<< operator, which treats the variables between the custom delimiters as strings, can be processed;
EOT a custom delimiter, which must be at the beginning of the line at the end;
Use << on the same page <标记
Tag
Note: The tag name is paired, the same page is not allowed to appear with the same name more than two tag names;
Another: The end tag name of the pairing tag name should be a single line, the output characters are not allowed before and after ... (such as spaces such as invisible but existing characters ...).
Pros: This allows you to output a large segment of HTML without escaping the quotes inside it or replacing the variable inside with a "."

How to output HTML code in PHP (EOT)
PHP code
Copy CodeThe code is as follows:
Echo <<< EOT











http://www.bkjia.com/PHPjc/321232.html www.bkjia.com true http://www.bkjia.com/PHPjc/321232.html techarticle in HTML and PHP writing, echo can output multiple strings at the same time, without the need for parentheses. Print can only output one string at a time, requiring parentheses. The use of print is very similar to the C language .

  • EOT;?> detailed source reference: http://www.jb51.net/article/16022.htm
    ClassID Stuno Student Name Parent's name Parent Mobile Number

    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.