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.
Related Articles Saistītie raksti
- 3 Column Relaxation WordPress Theme comments-paged.php for Paged-Comments WordPress Plugin 3 Column Atpūta WordPress Theme komentārus-paged.php par Paged-Komentāri WordPress Plugin
- How to Add and Put Picture or Image in MySpace Comment Kā pievienot un Noguldiet attēlu vai attēls MySpace Komentārs
- How to List and Show WordPress Posts That Comments and Pings Off (Not Allow) Kā to List un parādīt WordPress Amati, ka komentārus un impulsus, Off (Not Allow)
- Fight and Stop Comment Spam and Trackback Spam with Akismet Cīņa un Pietura Komentārs surogātpastu un Trackback Spam ar Akismet
- Free Download: Akismet for WordPress Plugin 2.0 to Stop Comment, Trackback and Pingback Spam Free Download: Akismet par WordPress Plugin 2,0 līdz Pietura Komentārs, Trackback un Pingback Spam
- Google AdSense Policy Update Disallows Image Besides Ads Blocks Google AdSense Policy Update Neļauj Image Bez Reklāmas Blocks
- Stop Comment, Pingback and Trackback Spam with New Version of Akismet Pietura Komentārs, Pingback un Trackback Spam ar jaunā versija Akismet
- Reduce Server Load Using Akismet to Automatically Discard Spam Comments on Posts Older than A Month Samazināt Server Load Izmantojot Akismet automātiski Izmest Spam Komentāri par Posts Vecāka nekā par mēnesi
- Moderate WordPress Blog Comments Via Moderator with Desktop Client Mērens WordPress Blog Comments Via moderatori ar Desktop Client
- Integrate WordPress including Comments with bbPress Forum using bbSync Integrējiet WordPress ieskaitot Komentāri ar bbPress Forum izmantojot bbSync










































January 16th, 2009 01:11 Janvāris 16, 2009 01:11
[...] 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 [...]
December 10th, 2007 01:30 Decembris 10, 2007 01:30
[...] 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: [...]
July 26th, 2006 06:45 Jūlijs 26, 2006 06:45
[...] [...] http://www.mydigitallife.info/2006/04/26/dis… http://www.mydigitallife.info/2006/04/26/dis ... . . [...] [...]