Several markup parsing _php tutorials for PHP scripts

Source: Internet
Author: User
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:/* */

 
  
  
  1. < ? PHP
  2. echo "This is a test"; Single-line Comments (C + + style),
  3. ?>?> effective,
  4. < /script > < /script> Invalid * /
  5. echo "This is yet another test";
  6. echo "one Final Test"; # single Comment (Shell style)
  7. ?>


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

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