Comments and Comment Blocks in PHP Pastabos ir komentarai Kvadratai PHP
PHP supports C language, C++ programming language and Unix shell-style (Perl style) comments. PHP palaiko C kalba C + + programavimo kalba ir Unix shell stiliaus (Perl stiliumi) pastabas. In PHP, // or # is used to make a single-line comment or /* and */ to make a large comment block that spans several lines. PHP, / / arba # naudojama atlikti vienoje eilutėje komentarą ar / * ir * / padaryti didelės komentarą blokas, kuri apima keletą eilučių.
For example: Pavyzdžiui:
<?php <? Php
echo 'This is a test'; //This is a single-line C++ style comment echo "Tai yra testas"; / / Tai vienos eilutės C + + stiliaus komentarus
echo 'This is another test';#This is another single-line shell-style comment echo "Tai kitas testas"; # Tai dar vienos linijos lukštais stiliaus komentarą
/* This is a multi line comment / * Tai daugeliui linija komentarą
Second line of comment */ Antroji eilutė comment * /
?> ?>
The “one-line” comment styles comment to the end of the line or the current block of PHP code, whichever comes first. "Viena linija" komentarą stilių komentarą linijos pabaigoje, ar dabartinės bloko PHP kodas, kas įvyks anksčiau. 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. Tai reiškia, kad HTML kodas po PHP skripto bloke (režimo PHP neveikia su> ir grąžina į HTML režimą po pabaigos PHP kodas blokas) bus spausdinamas. If the asp_tags configuration directive is enabled, it behaves the same with // %> and # %>. Jei asp_tags konfigūracijos direktyvos įjungtas, jis elgiasi kaip ir / /%> ir #%>. However, the </script> tag doesn't break out of PHP mode in a single-line comment. Tačiau, </ script> tag nėra Zawołać PHP režimą vienos eilutės pastabas.
For example, Pavyzdžiui,
<h1>This is an <?php # echo 'simple';?> example.<h1> <h1> Tai <? php # echo "paprastas";?> pvz. <h1>
<p>The header above will say 'This is an example'.</p> <p> antraštė virš pasakys: "Tai yra pavyzdys". </ p>
C or C++ style comments end at the first */ encountered. C ar C + + stiliaus komentarus pabaigos pirmojo * / sunkumus. 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. Bet zagnieżdżonych / * ir * / style komentarai sukelti klaidos, ir tai labai lengva padaryti šią klaidą, jeigu Jūs bandote komentarą iš didelių blokų kodo.
<?php <? Php
/* / *
echo 'This is a test'; /* This comment will cause a problem */ echo "Tai yra testas"; / * Šis komentaras sukels problemų * /
*/ * /
?> ?>
The PHP comments is useful when you want to comment or disable a large portion of HTML. PHP komentarai yra naudinga, kai norite komentuoti arba išjungti didelę 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 */. Vietoj komentarą į HTML kodą pagal kiekvieną eilutę, pastatyti visą HTML bloko PHP kodo fragmentą (pavyzdžiui, pridėti <? Php ir?>) Ir komentarai / * ir * /.
IMPORTANT : The page is machine translated and provided "as is" without warranty. DĖMESIO: Šis puslapis yra mašina išvertė ir pateikiama "kaip yra" be garantijų. Machine translation may be difficult to understand. Mašininio vertimo, gali būti sunku suprasti. Please refer to Remkitės original English article originalas anglų straipsnis whenever possible. jei įmanoma.
Related Articles Susiję straipsniai
- 3 Column Relaxation WordPress Theme comments-paged.php for Paged-Comments WordPress Plugin 3 skiltis Relaksacyjny WordPress temos komentarus-paged.php už Paged-Komentarai WordPress Plugin
- How to Add and Put Picture or Image in MySpace Comment Kaip pridėti ir Mettre Nuotrauka arba vaizdo į MySpace Komentaras
- How to List and Show WordPress Posts That Comments and Pings Off (Not Allow) Kaip sąrašas Parodyti WordPress Įrašai Tai Komentarai ir pingi Off (Ne Leisti)
- Fight and Stop Comment Spam and Trackback Spam with Akismet Kova ir Stop Comment Spam ir Trackback Šlamštas su Akismet
- Free Download: Akismet for WordPress Plugin 2.0 to Stop Comment, Trackback and Pingback Spam Free Download: Akismet skirtas WordPress Plugin 2.0 Stotelė Komentaras, Trackback ir Pingback Šlamštas
- Google AdSense Policy Update Disallows Image Besides Ads Blocks Google AdSense politika naujinimas Neleidžia Image Be skelbimai Kvadratas
- Stop Comment, Pingback and Trackback Spam with New Version of Akismet Stotelė Komentaras, Pingback ir Trackback Šlamštas su Naująja redakcija Akismet
- Reduce Server Load Using Akismet to Automatically Discard Spam Comments on Posts Older than A Month Sumažinti serverio apkrovos naudojimas Akismet į Automatiškai Išmesti Šlamštas Komentarai Žinutės Senesnės nei mėnuo
- Moderate WordPress Blog Comments Via Moderator with Desktop Client Vidutinis WordPress blog Komentarai Via Moderatorius su darbalaukio kliento
- Integrate WordPress including Comments with bbPress Forum using bbSync Integruoti WordPress įskaitant Komentarai su bbPress Forumas naudojant bbSync










































January 16th, 2009 01:11 Sausis 16th, 2009 01:11
[...] Er is een hack waarmee toch Hoge kwaliteit video kan geïntegreerd worden. [...] Er is een Hack waarmee Toch Hoge Kwaliteit vaizdo kan geïntegreerd worden. Zie How to Embed High Quality and Higher Resolution YouTube Videos on Blog or Website » My Digital Life [...] Zie Kaip Įterpti Aukštos kokybės ir didesnės raiškos YouTube Video Blog arba Svetainė »Mano skaitmeninis gyvenimas [...]
December 10th, 2007 01:30 Gruodžio 10 d. 2007 01:30
[...] tip of the hat to My Digital Life for his article - Comments and Comment Blocks in PHP. [...] Viršūnę skrybėlių į Mano skaitmeninis gyvenimas jo straipsnis - Komentarai ir komentuoti Kvadratai PHP. By Alec Tags: [...] By Alec Tags: [...]
July 26th, 2006 06:45 26 liepa 2006 06:45
[...] [...] http://www.mydigitallife.info/2006/04/26/dis… http://www.mydigitallife.info/2006/04/26/dis ... . . [...] [...]