What we're going to introduce to you today is about1, PHP script has four kinds of tags: short label and ASP tag is convenient but portability and poor distribution, usually not recommended. Also note that if you embed PHP in XML or XHTML you need to use standard tags < php?> to keep up with the standards.
A, standard label:<? php. ?>
B, script tag:< script language= "php" >...</script>
C, short label:<? ... ? > Need to set short _open_tag=on in php.ini, default is on, or add –enable-short-tags option when PHP is compiled. (PHP version 3 can also be activated with the Short_tags () function by using the short tag.) )
D, ASP tag (PHP 3.0.4 support): <% ...%> need to set asp_tags=on in php.ini, default is off
2, PHP script instruction delimiter: like C,java or Perl, PHP needs to end the instruction with a semicolon after each statement except for the last line (because the closing tag implies a semicolon). The end-of-file ellipsis is useful for using output buffers and include () or require ().
3, php script Comment: PHP supports c,c++ and Unix Shell style (Perl style) annotations. For example:
Single-line Comment://, #
Multiline Comment:/* */
- < ? PHP
- echo "This is a test"; Single-line Comments (C + + style),
- ?>?> effective,
- < /script > < /script> Invalid * /
- echo "This is yet another test";
- echo "one Final Test"; # single Comment (Shell style)
- ?>
http://www.bkjia.com/PHPjc/446259.html www.bkjia.com true http://www.bkjia.com/PHPjc/446259.html techarticle we are going to introduce to you today about 1, PHP script has four kinds of tags: short label and ASP tag is convenient but portability and poor distribution, usually not recommended. Also note if the PHP ...