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

PHP Tags & Comments - PHP tags and comments

WBOY
Release: 2016-07-29 08:59:27
Original
1346 people have browsed it

PHP tags

1. Standard Tags

Standard form

<code><span><?php</span><span>echo</span><span>'ABC'</span>; <span>?></span></code>
Copy after login

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>
Copy after login

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>
Copy after login

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>
Copy after login

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>
Copy after login

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>
Copy after login

PHP comments

1. One-line C++ style

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

2. One-line shell style

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

3. Multi-line comments

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

').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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template