Home >Backend Development >PHP Tutorial >PHP Tags & Comments - PHP tags and comments

PHP Tags & Comments - PHP tags and comments

WBOY
WBOYOriginal
2016-07-29 08:59:271348browse

PHP tags

1. Standard Tags

Standard form

<code><span><?php</span><span>echo</span><span>'ABC'</span>; <span>?></span></code>

2. Short Tags

You need to set short_open_tag = On in php.ini

<code><span><?</span><span>echo</span><span>'ABC'</span>; <span>?></span></code>

3. Echo Short Tags

Short form for short tag output
PHP5.4 and above versions no longer need to set short_open_tag when using this form

<code><span><?</span>=<span>'ABC'</span>; <span>?></span><span><?</span>=<span>'A'</span>,<span>'B'</span>,<span>'C'</span>; <span>?></span></code>

4. ASP-Style Tags

You need to set asp_tags = On in php.ini
PHP7 is obsolete and no longer used

<code><% <span>echo</span><span>'ABC'</span>; %></code>

5. Echo ASP-Style Tags

Need to set asp_tags = On in php.ini
PHP7 has been deprecated and is no longer used

<code><%=<span>'ABC'</span>; %></code>

6. Script Tags

PHP7 has been deprecated and is no longer used

<code><script language=<span>"php"</span>><span>echo</span><span>'ABC'</span>;</script></code>

PHP comments

1. One-line C++ style

<code><span>// This is a one-line c++ style comment</span></code>

2. One-line shell style

<code><span># This is a one-line shell-style comment</span></code>

3. Multi-line comments

<code><span>/* This is a multi line comment
   yet another line
   of comment */</span></code>

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above has introduced PHP Tags & Comments - PHP tags and comments, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:php 的 cURL库Next article:nginx+httpd+tomcat三