Comments and Comment Blocks in PHP Pripomienky a Comment Bloky v PHP
PHP supports C language, C++ programming language and Unix shell-style (Perl style) comments. PHP podporuje jazyk C, C + + programovací jazyk a Unix shell-štýl (Perl style) pripomienky. In PHP, // or # is used to make a single-line comment or /* and */ to make a large comment block that spans several lines. V PHP / / alebo # sa používa pre vytvorenie jednotnej-line komentár alebo / * a * /, aby sa veľké komentár blok, ktorý zahŕňa niekoľko okruhov.
For example: Napríklad:
<?php <? Php
echo 'This is a test'; //This is a single-line C++ style comment echo 'Toto je test'; / / Toto je jediný-line C + + Štýl komentár
echo 'This is another test';#This is another single-line shell-style comment echo 'Toto je ďalší test'; # To je ďalší z jedinej-line shell-štýl komentár
/* This is a multi line comment / * To je multifunkčné súlade komentár
Second line of comment */ Druhá línia comment * /
?> ?>
The “one-line” comment styles comment to the end of the line or the current block of PHP code, whichever comes first. "One-line" komentár štýly komentár do konca riadku alebo súčasného bloku PHP kódu, čo nastane skôr. 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. To znamená, že HTML kód PHP skriptu bloku (PHP režime rozbity?> A vráti sa do režimu HTML po ukončení bloku PHP kódu) bude vytlačený. If the asp_tags configuration directive is enabled, it behaves the same with // %> and # %>. Ak asp_tags konfiguráciu smernice je povolené, bude sa správať podobne ako / /%> a #%>. However, the </script> tag doesn't break out of PHP mode in a single-line comment. Avšak, </ script> značku nemá vypuknout PHP režimu v jednom-line komentár.
For example, Napríklad
<h1>This is an <?php # echo 'simple';?> example.<h1> <h1> Toto je <? php # echo 'simple';?> príklad. <h1>
<p>The header above will say 'This is an example'.</p> <p> hlavičku nad povie 'Toto je príklad'. </ p>
C or C++ style comments end at the first */ encountered. C alebo C + + Štýl komentáre na konci prvého * / stretli. 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. Akékoľvek vnoření / * a * / komentáre štýlu spôsobí chybu, a je to docela jednoduché, aby to bolo chybou, ak sa snažíte komentár z veľkého bloku kódu.
<?php <? Php
/* / *
echo 'This is a test'; /* This comment will cause a problem */ echo 'Toto je test'; / * Tento komentár spôsobí problém * /
*/ * /
?> ?>
The PHP comments is useful when you want to comment or disable a large portion of HTML. PHP komentáre je užitočné, keď chcete vyjadriť alebo zakázať veľkú časť 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 */. Miesto komentár HTML kódu riadok po riadku, vložte celý blok HTML kódu v PHP bloku (tj pridať <? Php a?>) A komentár s / * a * /.
IMPORTANT : The page is machine translated and provided "as is" without warranty. Upozornenie: Stránka je stroje preložené a poskytované "tak ako sú" bez záruky. Machine translation may be difficult to understand. Strojový preklad môže byť ťažké pochopiť. Please refer to Obráťte sa prosím na original English article Anglický originál článku whenever possible. kedykoľvek je to možné.
Related Articles Súvisiace články
- 3 Column Relaxation WordPress Theme comments-paged.php for Paged-Comments WordPress Plugin 3 Kolóna WordPress Relaxačný Téma komentáre-paged.php pre stránkovania-Komentáre WordPress Plugin
- How to Add and Put Picture or Image in MySpace Comment Ako pridať a Polož Picture alebo obrazu vo MySpace Komentáre
- How to List and Show WordPress Posts That Comments and Pings Off (Not Allow) Ako Zoznam Zobraziť WordPress a príspevky, ktoré Pripomienky a Odošle príkaz Ping Off (nedovolí)
- Fight and Stop Comment Spam and Trackback Spam with Akismet Boj a Stop Comment Spam a Trackback Spam s Akismet
- Free Download: Akismet for WordPress Plugin 2.0 to Stop Comment, Trackback and Pingback Spam Zdarma na stiahnutie: Akismet pre WordPress Plugin 2,0 až Stop komentár, Pingback a Trackback Spam
- Google AdSense Policy Update Disallows Image Besides Ads Blocks Google AdSense politiky Update Znemožní Image Okrem reklamy Bloky
- Stop Comment, Pingback and Trackback Spam with New Version of Akismet Stop Komentáre, Pingback a Trackback Spam s Akismet Nová verzia
- Reduce Server Load Using Akismet to Automatically Discard Spam Comments on Posts Older than A Month Znížiť Server Načítať Použitie Akismet až Automaticky Zbaviť Spam Poznámky o príspevky Staršie ako jeden mesiac
- Moderate WordPress Blog Comments Via Moderator with Desktop Client Mierny WordPress Blog Poznámky Pomocou Moderátor s Desktop Klient
- Integrate WordPress including Comments with bbPress Forum using bbSync Integrujte WordPress vrátane Komentár s bbPress fórum pomocou bbSync










































January 16th, 2009 01:11 16. január 2009 01:11
[...] Er is een hack waarmee toch Hoge kwaliteit video kan geïntegreerd worden. [...] Er je een hack waarmee toch Hoge Kwaliteit video geïntegreerd kan worden. Zie How to Embed High Quality and Higher Resolution YouTube Videos on Blog or Website » My Digital Life [...] Zie Ako embed vysokej kvalite a vyššom rozlíšení YouTube Video na Blog alebo webová stránka »Má Digital Duch [...]
December 10th, 2007 01:30 10. decembra 2007 01:30
[...] tip of the hat to My Digital Life for his article - Comments and Comment Blocks in PHP. [...] Tip na klobúk na My Digital Life pre svoj článok - Poznámky a komentár Bloky v PHP. By Alec Tags: [...] Do Alec Tagy: [...]
July 26th, 2006 06:45 26. júla 2006 06:45
[...] [...] http://www.mydigitallife.info/2006/04/26/dis… http://www.mydigitallife.info/2006/04/26/dis ... . . [...] [...]