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.