Comments and Comment Blocks in PHP Commento commenti e blocchi in PHP
PHP supports C language, C++ programming language and Unix shell-style (Perl style) comments. PHP supporta linguaggio C, C + + linguaggio di programmazione e shell Unix-stile (stile Perl) commenti. 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, / / o # è usato per fare una sola riga di commento o / * e * / a fare un grande blocco di commento che abbraccia diverse linee.
For example: Per esempio:
<?php <? php
echo ‘This is a test’; //This is a single-line C++ style comment echo 'Questo è un test'; / / Si tratta di una singola riga di C + + stile commento
echo ‘This is another test’;#This is another single-line shell-style comment echo 'Questo è un altro test'; # Questo è un altro singolo-line shell stile commento
/* This is a multi line comment / * Questo è un multi linea commento
Second line of comment */ Seconda linea di commento * /
?>
The “one-line” comment styles comment to the end of the line or the current block of PHP code, whichever comes first. Il "one-line" stili commento commento alla fine della linea o l'attuale blocco di codice PHP, che si verifica per primo. 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. Ciò significa che il codice HTML dopo il blocco di script PHP (PHP rotto con modalità?> E ritorna alla modalità HTML dopo la fine del blocco di codice PHP) verrà stampato. If the asp_tags configuration directive is enabled, it behaves the same with // %> and # %>. Asp_tags se la direttiva di configurazione è attivata, si comporta con la stessa / /%> e #%>. However, the </script> tag doesn’t break out of PHP mode in a single-line comment. Tuttavia, la </ script> tag non uscire di PHP modalità in un'unica riga di commento.
For example, Per esempio,
<h1>This is an <?php # echo ’simple’;?> example.<h1> <h1> Questo è un <? php # echo 'semplice';?> esempio. <h1>
<p>The header above will say ‘This is an example’.</p> <p> L'intestazione sopra dirà 'Questo è un esempio'. </ p>
C or C++ style comments end at the first */ encountered. C o C + + stile commenti fine al primo * / incontrate. 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. Qualsiasi nidificate / * e * / commenti stile farà errore, ed è abbastanza facile fare questo errore, se stai provando a commentare un blocco di codice.
<?php <? php
/* / *
echo ‘This is a test’; /* This comment will cause a problem */ echo 'Questo è un test'; / * Questo commento causerà un problema * /
*/ * /
?>
The PHP comments is useful when you want to comment or disable a large portion of HTML. I commenti di PHP è utile quando si desidera commentare o disattivare una grande porzione di codice 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 */. Commento invece il codice HTML riga per riga, mettere il tutto in blocco HTML blocco di codice PHP (ad esempio, aggiungere <? Php e?>) E con il commento / * e * /.
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANTE: Questa è una pagina tradotta macchina che è fornito "così com'è" senza alcuna garanzia. Machine translation may be difficult to understand. Traduzione automatica può essere difficile da capire. Please refer to Si prega di fare riferimento a original English article articolo originale in lingua inglese whenever possible. quando possibile.
Share and contribute or get technical support and help at Condividere e contribuire o ottenere supporto tecnico e assistenza in My Digital Life Forums La mia vita digitale Forum .
Related Articles Articoli correlati
- 3 Column Relaxation WordPress Theme comments-paged.php for Paged-Comments WordPress Plugin 3 colonne Relax WordPress Tema commenti-paged.php per paginati-Commenti WordPress Plugin
- Fight and Stop Comment Spam and Trackback Spam with Akismet E smettere di combattere lo spam di commenti e trackback spam con Akismet
- Integrate WordPress including Comments with bbPress Forum using bbSync Integrare WordPress compresi Commenti con bbPress Forum utilizzando bbSync
- PHP Parse Error: syntax error, unexpected $end PHP Parse Error: errore di sintassi, inaspettata fine $
- How to Add and Put Picture or Image in MySpace Comment Come aggiungere e mettere immagini o l'immagine in MySpace commento
- Reduce Server Load Using Akismet to Automatically Discard Spam Comments on Posts Older than A Month Ridurre carico del server utilizzando Akismet a scartare automaticamente lo spam commenti su posti di età superiore a un mese
- Free Download: Akismet for WordPress Plugin 2.0 to Stop Comment, Trackback and Pingback Spam Download gratuito: Akismet per WordPress Plugin 2,0 a Stop commento, Trackback e Pingback Spam
- Stop Comment, Pingback and Trackback Spam with New Version of Akismet Commento stop, Pingback Trackback Spam e con la Nuova Versione di Akismet
- WordPress 2.2 Released for Free Download WordPress 2,2 immesse in libera Download
- Rapid Leech Download from RapidShare, MegaUpload, Uploading, MyTempDir and Other File Sharing Services to Server Leech rapida da il tempo di download, MEGAUPLOAD, il caricamento, MyTempDir e Altri Servizi Condivisione file al server









July 26th, 2006 06:45 26 luglio 2006 06:45
[...] http://www.mydigitallife.info/2006/04/26/dis… . [...]
December 10th, 2007 01:30 Dicembre 10, 2007 01:30
[...] tip of the hat to My Digital Life for his article - Comments and Comment Blocks in PHP. [...] La punta del mio cappello a Digital Life per il suo articolo - Commenti e commento Blocchi in PHP. By Alec Tags: [...] Di Alec Tag: [...]