Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the styles of php tags?

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

Today, the editor will share with you the relevant knowledge points about the style of php markings, which are detailed in content and clear in logic. I believe most people still know too much about this, so share this article for your reference. I hope you can get something after reading this article.

There are four styles: 1, XML style, grammar "; 2, short style, grammar"; 3, ASP style, grammar "; 4, SCRIPT style, grammar". "

Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer

The so-called tag is a special symbol (for example) used to make it easier to distinguish from other content. In PHP, when parsing a file in .php format, PHP looks for the opening and closing tags, and any text between the two tags is interpreted as PHP code. Any text outside the tag is considered regular HTML, which means that PHP tags can isolate PHP code from HTML.

There are four markup styles in PHP, which will be introduced one by one below.

1. XML style

This is the most frequently used markup style, and it is also the markup style recommended by PHP.

This style is enabled by default and cannot be disabled, so it is guaranteed that this style of markup can be used on all servers, especially when writing applications for different server environments.

2. Short style

To use this markup style, which is the simplest, you need to enable the short_open_tag option in the configuration file php.ini. However, this style of markup is not recommended in day-to-day development, because it is no longer supported in the default settings of many environments.

3. ASP style (removed)

This markup style is the same as that of ASP or ASP.NET, which is disabled by default. If you want to use it, you need to enable the asp_tags option in the configuration settings.

However, this markup style is no longer supported in PHP7, so you can understand it.

4. SCRIPT style (removed)

Echo''

This markup style is the longest, and readers will be familiar with it if they have used JavaScript or VBScript.

This markup style is no longer supported in PHP7, so you can understand it.

Note: if the content of the file is pure PHP code, it is best to omit the PHP closing tag at the end of the file. This avoids misoperations such as accidental insertion of spaces or line breaks after the PHP closing tag, resulting in unexpected spaces and line breaks in the output.

This is all the content of the article "what is the style of php markup?" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report