PHP tag style?

Source: Internet
Author: User
ArticleDirectory
    • Short_open_tag and asp_tags in PHP. ini
PHP tag style?

 

PHP markup has four different styles available for us. The following four paragraphsCodeAll are equivalent.

XML style

It is a tag style recommended for PHP. The server administrator cannot disable this type of tag. Therefore, you can ensure that this type of tag is used on all servers, especially for applications used in different server environments.ProgramThis tag style is particularly important. This style of markup can be used in XML (Extensible Markup Language) documents. If you want to use XML in your site, you must use this tag style.

Brief style

This markup style is the simplest, and complies with the style described in SGML (standard general-purpose syntax) processing. To use this tag style-enter at least characters-you must enable the short_open_tag option in the configuration file or enable the short tag option to compile PHP.

Script Style

This tag style is the longest. If JavaScript or VBScript is used, you will be familiar with this style. If the HTML editor used does not support other tag Styles, you can use it.

ASP Style

The tag style is the same as that of Active Server Page (ASP) or ASP. NET. If the asp_tags option is enabled in the configuration settings, you can use it. If the editor is designed for ASP or ASP. NET, or you are used to ASP or ASP. NET programming style, you may want to use it. However, note that the tag style is disabled by default.

 

Short_open_tag and asp_tags in PHP. ini

Short_open_tag

Determine whether to allow the abbreviated form of the PHP code start sign (<? ?> ). If you want to use PHP in combination with XML, you can disable this option for Embedded use. <? XML?> . Otherwise, PHP can be used for output, for example: <? PHP echo '<? XML version = "1.0" ';?> . If disabled, you must use the complete form of the PHP code start flag (<? PHP?> ).

Note: This command also affects the abbreviated form <? =, It matches <? ECHO is equivalent. The short_open_tag value is on.

Asp_tags

Except for the common <? PHP?> ASP-style flag is also allowed <%>. This also includes the abbreviation of the output variable value <% = $ Value %>.
Note: ASP style labels are newly added in version 3.0.4.

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.