note 125360 added to language.basic-syntax.phpmode
| From: | anisgazig at gmail dot com | Date: | Sun, 13 Sep 2020 06:36:35 +0000 |
| Subject: | note 125360 added to language.basic-syntax.phpmode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-215110@lists.php.net to get a copy of this message | ||
In php there are 3 types of comments
1.single line c++ style comment(//)
2.single line Unix shell stype comment(#)
3.multi line c style comment(/*/)
single or multi line comment comes to the end of the line or come first to the current block of php
code.
HTML code will be printed after //...?> or #...?>
closing tag breaks the php mode and return to html mode.
different comments in different tags:
===================================
<H1>Standard tag: <?php //echo " standard tag"; ?>single line c++ style
comment</H1>
<p>The header above will break php mode and return html mode and show 'Standard
tag:single line c++ style comment'</p>
<H1>Standard tag: <?php # echo " standard tag"; ?>single line unix shell
style comment</H1>
<p>The header above will break php mode and return html mode and show 'Standard
tag:single line unix shell style comment'</p>
<H1>Standard tag: <?php /*echo " standard tag"; */?>multi line c style
comment</H1>
<p>The header above will break php mode and return html mode and show 'Standard
tag:multi line c style comment'</p>
<H1>short echo tag: <?= // " short echo tag"; ?>single line c++ style
comment</H1>
<p>The header above will break php mode show a unexpected syntex error'</p>
<H1>short echo tag: <?= # " short echo tag"; ?>single line c++ style
comment</H1>
<p>The header above will break php mode show a unexpected syntex error'</p>
<H1>short echo tag: <?= /*echo " short echo tag"*/ ; ?>multiple line c
style comment</H1>
<p>The header above will break php mode show a unexpected syntex error'</p>
<H1>Short tag: <? //echo " short tag";?>single line c++ style
comment</H1>
<p>The header above will break php mode and return html mode and show 'Short tag:single
line c++ style comment'</p>
<H1>Short tag: <? #echo " short tag";?>single line unix shell style
comment</H1>
<p>The header above will break php mode and return html mode and show 'Short tag:single
line unix shell style comment'</p>
<H1>Short tag: <? /* echo " short tag";*/?>multi line c style
comment</H1>
<p>The header above will break php mode and return html mode and show 'Short tag:multi
line c style comment'</p>
<H1>Script tag: <script language="php"> // echo " script
tag";</script>single line c++ style comment</H1>
<p>The header above will break php mode and return html mode and show 'Script
tag:single line c++ style comment'</p>
<H1>Script tag: <script language="php"> /* echo " script
tag";*/</script>multi line c style comment</H1>
<p>The header above will break php mode and return html mode and show 'Script tag:multi
line c style comment'</p>
<H1>Script tag: <script language="php"> # echo " script
tag";</script>single line unix shell style comment</H1>
<p>The header above will not break php mode </p>
----
Server IP: 45.112.84.4
Probable Submitter: 103.51.167.36 (proxied: 116.204.228.198)
----
Manual Page -- http://php.net/manual/en/language.basic-syntax.phpmode.php
Edit -- https://master.php.net/note/edit/125360
Del: integrated -- https://master.php.net/note/delete/125360/integrated
Del: useless -- https://master.php.net/note/delete/125360/useless
Del: bad code -- https://master.php.net/note/delete/125360/bad+code
Del: spam -- https://master.php.net/note/delete/125360/spam
Del: non-english -- https://master.php.net/note/delete/125360/non-english
Del: in docs -- https://master.php.net/note/delete/125360/in+docs
Del: other reasons-- https://master.php.net/note/delete/125360
Reject -- https://master.php.net/note/reject/125360
Search -- https://master.php.net/manage/user-notes.php