4 types of markup styles in PHP introduction _php tutorial

Source: Internet
Author: User
Look at the forum today, see a novice error code, looked for a long time did not find errors. I'm just wondering. (What is this for?) Oh
Later discovered the tagging problem, he used a short mark. And my php.in configuration doesn't turn it on. Hey, shame on you!

1.xml Style (recommended for standard style)

Copy CodeThe code is as follows:
echo "This is an XML-style tag";
?>

XML-style markup is a common tag and is the recommended tag, and the server cannot be disabled, and the style tag can be used in xml,xhtml.

2. Scripting style

Copy CodeThe code is as follows:



3. Short style

Copy CodeThe code is as follows:


Note: You need to set short _open_tag=on in php.ini, default is on, or add the –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.) )


4.asp style

Copy CodeThe code is as follows:
<%
Echo ' This is an ASP-style tag ';
%>


Note: Asp_tags = On is required to be turned on in the php.ini configuration file;

The above ASP style and short style need to be set in php.ini. The default is not supported.

Note: Support for ASP style tagging is added in version 3.0.4.

Note: You should avoid using short marks when developing programs or libraries that need to be released, or on servers that the user cannot control. Because the target server may not support short tokens. For code porting and distribution, be sure not to use short marks.

http://www.bkjia.com/PHPjc/325475.html www.bkjia.com true http://www.bkjia.com/PHPjc/325475.html techarticle look at the forum today, see a novice error code, looked for a long time did not find errors. I'm just wondering. (What is this for?) Oh Later found the mark problem, he made ...

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