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 .



2 Responses to “Comments and Comment Blocks in PHP” 2 risposte a "Commenti e commento Blocchi in PHP"

  1. E-Volution IT » Blog Archive » Windows Genuine Advantage circumvention E-Volution IT "Blog" Windows Genuine Advantage elusione
    July 26th, 2006 06:45 26 luglio 2006 06:45
    1

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

  2. How to Comment Code in WordPress Templates Come commentare questo codice in Modelli di WordPress
    December 10th, 2007 01:30 Dicembre 10, 2007 01:30
    2

    [...] 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: [...]

Leave a Reply Lasciare una risposta

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> È possibile utilizzare questi tag: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q Cite=""> <strike> <strong>

Subscribe without commenting Iscriviti senza commentare


Custom Search

New Articles Nuovi articoli

Incoming Search Terms for the Article Cerca in arrivo Condizioni per l'articolo

comment out php commentare PHP - -- php comment out PHP commento - -- comentario em php commento a PHP - -- comentário em php commento a PHP - -- comment out in php commentare in PHP - -- comentario php PHP commento - -- comment out php code commentare codice PHP - -- how to comment out php come commentare PHP - -- php coment PHP Coment - -- php coments PHP coments - -- php comment PHP commento - -- how to comment out PHP code come commentare codice PHP - -- commenting out in php commentando in PHP - -- free coments libero coments - -- php comment block of code PHP commento blocco di codice - -- myspace comment blocks MySpace commento blocchi - -- coment php Coment PHP - -- php comment blocks PHP commento blocchi - -- comentário php PHP commento - -- comment blocks for myspace blocchi di commento per MySpace - -- PHP comentario PHP commento - -- remark out php annotazione di PHP - -- comment out a block of code in unix commentare un blocco di codice in UNIX - -- como comentar em PHP Como comentar em PHP - -- comentario no php nessun commento PHP - -- myspace comment bocks MySpace commento bocks - -- php comment out blocks PHP commentare blocchi - -- php commenting PHP commentando - -- php commenting out PHP commentando le - -- php comment a block of code php commento a un blocco di codice - -- comment out block of php commentare blocco di PHP - -- php comment block PHP commento blocco - -- comment block in unix commento blocco in Unix - -- coment in php Coment in PHP - -- comment blocks on myspace blocchi di commento su MySpace - -- hOW TO coment in PHP Come Coment in PHP - -- "comentario em php" "commento a PHP" - -- comentários em php commenti a PHP - -- comentario en php it PHP commento - -- php coments code codice PHP coments - -- php block of comment PHP blocco di commento - -- PHP commenting out a block of code PHP commentare un blocco di codice - -- free coments on internet coments libera su internet - -- comment block for myspace commento blocco per MySpace - -- comentar php comentar PHP - -- comments tag block in pHP commenti etichetta blocco in PHP - -- italian coments about life coments italiano sulla vita - -- PHP + commenting PHP + commentando - -- norsk comments code Norsk commenti codice - -- comment in PHP commento in PHP - --