Comments and Comment Blocks in PHP Komentāri un Komentārs bloki PHP

PHP supports C language, C++ programming language and Unix shell-style (Perl style) comments. PHP atbalsta C valoda, C + + programmēšanas valodu un Unix shell-stils (Perl stils) komentārus. In PHP, // or # is used to make a single-line comment or /* and */ to make a large comment block that spans several lines. In PHP, / / vai # izmanto vienotu tiešsaistes komentēt vai / * un * / veikt liela komentēt bloks, kas aptver vairākas līnijas.

For example: Piemēram:

<?php <? php

echo 'This is a test'; //This is a single-line C++ style comment echo "Šis ir tests"; / / Šī ir viena līnija C + + stils komentāru
echo 'This is another test';#This is another single-line shell-style comment echo "Šis ir vēl viens tests"; # Tas ir vēl viena līnija apvalks stila komentēt
/* This is a multi line comment / * Tas ir vairāku līniju komentāru
Second line of comment */ Otrā līnija komentārs * /

?> ?>

The “one-line” comment styles comment to the end of the line or the current block of PHP code, whichever comes first. Ar "vienas līnija" komentēt stili komentēt līdz līnijai vai pašreizējā bloka PHP kodu, kas notiek vispirms. This means that HTML code after the PHP script block (PHP mode broken with ?> and returns to HTML mode after end of PHP code block) will be printed. Tas nozīmē, ka HTML kods pēc PHP skripta bloks (PHP režīmā sadalot ar?> Un atgriežas HTML režīmā pēc beigām PHP kods bloks) tiks drukāts. If the asp_tags configuration directive is enabled, it behaves the same with // %> and # %>. Ja asp_tags konfigurācijas direktīva ir iespējota, tas uzvedas tā pati ar / /%> un #%>. However, the </script> tag doesn't break out of PHP mode in a single-line comment. Tomēr, </ script> taga nav pārtraukumu no PHP režīmā ar vienu tiešsaistes komentārus.

For example, Piemēram,

<h1>This is an <?php # echo 'simple';?> example.<h1> <h1> Tas ir <? php # echo "vienkāršs";?> piemērs. <h1>
<p>The header above will say 'This is an example'.</p> <p> Galvenes iepriekš pateikt "Tas ir piemērs". </ p>

C or C++ style comments end at the first */ encountered. C vai C + + stils piezīmes beigās pēc pirmās * / radušās. Any nested /* and */ style comments will cause error, and it's pretty easy to make this mistake if you are trying to comment out a large block of code. Jebkurš Nested / * un * / style apsvērumus izraisīt kļūdas, un tas ir diezgan viegli, lai šī kļūda, ja jūs mēģināt komentēt, kas ir liels bloks kodu.

<?php <? php

/* / *
echo 'This is a test'; /* This comment will cause a problem */ echo "Šis ir tests"; / * Tas būs radīt problēmas * /
*/ * /

?> ?>

The PHP comments is useful when you want to comment or disable a large portion of HTML. The PHP komentāri ir noderīgi, ja vēlaties komentēt vai atspējot liela daļa no HTML. Instead comment the HTML code line by line, put the whole HTML block into PHP code block (ie, add <?php and ?>) and comment with /* and */. Tā vietā Komentāru HTML kods pozīcijas, kas kopumā HTML bloka vērā PHP koda bloka (ti, pievienot <? Php un?>) Un komentārus ar / * un * /.

IMPORTANT : The page is machine translated and provided "as is" without warranty. SVARĪGI: Šī lapa ir mašīna tulkoto un ar nosacījumu ", kas ir" bez garantijas. Machine translation may be difficult to understand. Machine translation var būt grūti saprast. Please refer to Lūdzu, skatiet original English article oriģināls angļu rakstu whenever possible. kad vien iespējams.


3 Responses to “Comments and Comment Blocks in PHP” 3 atbildes uz "Komentāri un Komentārs bloki PHP"

  1. Walter De Vos » Hoe High Quality YouTube Videos embedden Walter de vos »kaplis Augstas kvalitātes YouTube Videos embedden
    January 16th, 2009 01:11 Janvāris 16, 2009 01:11
    3 3

    [...] Er is een hack waarmee toch Hoge kwaliteit video kan geïntegreerd worden. [...] Er is een banalizēt waarmee toch Hoge kwaliteit video kan geïntegreerd worden. Zie How to Embed High Quality and Higher Resolution YouTube Videos on Blog or Website » My Digital Life [...] Zie Kā Iegultnes Augstas kvalitātes un augstākās Rezolūcija YouTube Videos Blog vai Website »Mans Digital Life [...]

  2. How to Comment Code in WordPress Templates Kā Komentārs kods WordPress Veidnes
    December 10th, 2007 01:30 Decembris 10, 2007 01:30
    2 2

    [...] tip of the hat to My Digital Life for his article - Comments and Comment Blocks in PHP. [...] Galu cepuru Mans Digital Life viņa pantam - Komentāri un Komentārs bloki PHP. By Alec Tags: [...] Ar Alec Birkas: [...]

  3. E-Volution IT » Blog Archive » Windows Genuine Advantage circumvention E-Volution IT »Blog Archive» Windows Genuine Advantage apiešana
    July 26th, 2006 06:45 Jūlijs 26, 2006 06:45
    1 1

    [...] [...] http://www.mydigitallife.info/2006/04/26/dis… http://www.mydigitallife.info/2006/04/26/dis ... . . [...] [...]

Leave a Reply Atstāj atbildi

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Jūs varat izmantot šos tagus: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. Parakstīties uz komentāriem iezīme ir atspējota. To receive notification of latest comments posted, subscribe to Lai saņemtu paziņojumu par jaunāko komentāri norīkots darbā, abonēt My Digital Life Comments RSS feed Mani Digital Life Comments RSS feed or vai register to receive reģistrēties, lai saņemtu new comments in daily email digest. jauni komentāri ikdienas e-pasta sagremot.
Custom Search

New Articles Jauns pants

Incoming Search Terms for the Article Incoming Meklēt Noteikumi par pants

comment out php komentārus, kas php - -- coment php coment php - -- php coment php coment - -- how to comment out php kā komentārs no php - -- php comment out php komentārus, kas - -- php comment blocks php komentēt bloki - -- php coments php coments - -- coments in php coments in php - -- comentar em php comentar em php - -- php comment block php komentēt bloks - -- coments php coments php - -- comentário php comentário php - -- comment out in php komentārus, kas php - -- php comment out block php komentārus no grupālā - -- coment in php coment in php - -- coment on php coment par php - -- comentario em php comentario em php - -- como comentar em php como comentar em php - -- all viss - -- comentário em php comentário em php - -- html comment block html komentēt bloks - -- comment block in php komentēt bloks php - -- myspace comment blocks MySpace comment bloki - -- php comentario php comentario - -- comment out php script komentārus, kas php skripts - -- php block comments php bloķēt komentāri - -- comentários php Piezīmes php - -- comment blocks in php komentēt bloki php - -- PHP comment block code PHP komentārus bloķēt kods - -- how to coment in php kā coment in php - -- comment block php komentēt bloķēt php - -- comentario en php comentario en php - -- comment blocks of php komentēt bloki php - -- how to comment out php code kā komentārs no php kods - -- comment blocks PHP komentēt bloki PHP - -- comment block of php code komentēt bloku php kods - -- block comment php bloķēt komentēt php - -- comentários em php Piezīmes em php - -- coment out php coment ārpus php - -- comment php blocks komentēt php bloki - -- myspace comments blocks MySpace komentāri bloki - -- php comment out blocks of code php komentārus, kas bloki kods - -- php + comment out a block of code php + komentēt ārpus bloka koda - -- comment block of code php komentēt bloku kods php - -- comentarios em php Piezīmes em php - -- "comment out in php" "comment norādīti php" - -- comentario php comentario php - -- block comment out php bloķēt komentārus no php - -- comment block in html komentēt bloks html - -- comentar no php comentar ne php - --