Echo in HTML and PHP can output multiple strings at the same time without parentheses.
Print can only output one string at a time, and parentheses are required.
The usage of print is similar to that of C language, so it will make a special explanation of % in the output content.
ECHO has no return value, and print () has a return value. flase is returned when its execution fails (such as disconnection.
ECHO can have multiple parameters and print one parameter. ECHO is recommended.
Let's take a look at the following example to understand what print <EOT is used in PHP:CopyCodeThe Code is as follows: Print <EOT
<HTML>
<Head> <Body>
$ Value;
...
</Body>
<HTML>
EOT;
Meaning:
<Operator, which treats the content between user-defined delimiters as strings and processes the variables in them;
EOT custom delimiters. The end must be at the beginning of the line;
Use the <tag
Mark;
Note: When tag names are matched, two or more tag names cannot appear on the same page with the same name;
In addition, the end tag name of the paired tag name should be a separate line, and no leading or trailing characters can be output... (such as spaces and other invisible but existing characters ..).
Advantage: in this way, you can output a large HTML segment and automatically replace the variables in it without escaping the quotation marks.
How to output HTML code (EOT) in PHP)
PHP codeCopy codeThe Code is as follows: <? PHP
Echo <EOT
<Table width = 80% border = "2" cellpadding = "3" cellspacing = "0" bordercolor = "#808080">
<Tr bgcolor = "#84a9e1">
<TD align = "center"> classid </TD>
<TD align = "center"> stuno </TD>
<TD align = "center"> Student name </TD>
<TD align = "center"> parent name </TD>
<TD align = "center"> parents' mobile phone number </TD>
</Tr>
EOT;
?>
Detailed source reference: http://www.jb51.net/article/16022.htm