Comments and Comment Blocks in PHP Observations et commentaires blocs en PHP

PHP supports C language, C++ programming language and Unix shell-style (Perl style) comments. PHP supporte le langage C, C + + langage de programmation et Unix shell-style (style Perl) commentaires. In PHP, // or # is used to make a single-line comment or /* and */ to make a large comment block that spans several lines. En PHP, / / ou # est utilisé pour faire une seule ligne de commentaire ou / * et * / à faire un grand bloc de commentaire qui s'étend sur plusieurs lignes.

For example: Par exemple:

<?php <? php

echo ‘This is a test’; //This is a single-line C++ style comment echo 'Ceci est un test', / / C'est une simple ligne C + + style commentaire
echo ‘This is another test’;#This is another single-line shell-style comment echo 'Ceci est un autre test'; # Ceci est un autre seule ligne shell-style commentaire
/* This is a multi line comment / * Ceci est un commentaire multi ligne
Second line of comment */ Deuxième ligne de commentaire * /

?> >

The “one-line” comment styles comment to the end of the line or the current block of PHP code, whichever comes first. La "une ligne" commentaire styles commentaire à la fin de la ligne ou le bloc courant de code PHP, selon la première éventualité. 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. Cela signifie que le code HTML après le bloc de script PHP (PHP rompu avec le mode> et retourne à mode HTML après la fin du bloc de code PHP) sera imprimé. If the asp_tags configuration directive is enabled, it behaves the same with // %> and # %>. Si la directive asp_tags de configuration est activé, il se comporte de même avec / /%> #%>. However, the </script> tag doesn’t break out of PHP mode in a single-line comment. Toutefois, le </ script> tag ne pas sortir du mode PHP dans une seule ligne de commentaires.

For example, Par exemple,

<h1>This is an <?php # echo ’simple’;?> example.<h1> <h1> Il s'agit d'un <? php # echo 'simple';> exemple. <h1>
<p>The header above will say ‘This is an example’.</p> <p> L'en-tête ci-dessus dire «Ceci est un exemple". </ p>

C or C++ style comments end at the first */ encountered. C ou C + + style de commentaire fin à la première * / rencontrées. 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. Toute imbriqués / * et * / style de commentaire fera erreur, et il est assez facile de faire cette erreur si vous essayez de commenter un grand bloc de code.

<?php <? php

/* / *
echo ‘This is a test’; /* This comment will cause a problem */ echo 'Ceci est un test', / * Ce commentaire va poser un problème * /
*/ * /

?> >

The PHP comments is useful when you want to comment or disable a large portion of HTML. Les commentaires PHP est utile lorsque vous voulez faire un commentaire ou désactiver une grande partie de code 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 */. Au lieu commenter le code HTML ligne par ligne, l'ensemble de bloc HTML en bloc de code PHP (c'est-à-dire, ajouter <? Php et?>) Et commenter avec / * et * /.

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANT: Il s'agit d'une machine qui traduit la page est fourni «tel quel», sans garantie. Machine translation may be difficult to understand. La traduction automatique mai être difficile à comprendre. Please refer to S’il vous plaît se référer à original English article l'article original en anglais whenever possible. chaque fois que possible.

Share and contribute or get technical support and help at Partagez et contribuer ou obtenir de l'aide technique et l'aide à My Digital Life Forums Ma vie numérique forums .



2 Responses to “Comments and Comment Blocks in PHP” 2 réponses à "Commentaires et commentaires Blocs en PHP"

  1. E-Volution IT » Blog Archive » Windows Genuine Advantage circumvention E-volution IT »Blog Archive» Windows Genuine Advantage contournement
    July 26th, 2006 06:45 Juillet 26th, 2006 06:45
    1

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

  2. How to Comment Code in WordPress Templates Comment un commentaire code dans wordpress modèles
    December 10th, 2007 01:30 Décembre 10th, 2007 01:30
    2

    [...] tip of the hat to My Digital Life for his article - Comments and Comment Blocks in PHP. [...] Coup de chapeau à Ma vie numérique pour son article - Commentaires et commentaires blocs en PHP. By Alec Tags: [...] Par Alec tags: [...]

Leave a Reply Laisser un commentaire

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> Vous pouvez utiliser ces balises: <a href="" title="fete_christel <abbr title="fete_christel <acronym title="fete_christel <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q Cite=""> <strike> <strong>

Subscribe without commenting S'abonner sans commentaires


Custom Search

New Articles Nouveaux Articles

Incoming Search Terms for the Article Des termes de recherche utilisés pour l'article

comment out php commenter PHP - -- php comment out PHP commenter - -- comentario em php em commentaire PHP - -- comentário em php un commentaire PHP em - -- comment out in php commenter en PHP - -- comentario php PHP commentaire - -- comment out php code en commentaire du code PHP - -- how to comment out php comment faire des observations sur PHP - -- php coment PHP Coment - -- php coments PHP coments - -- php comment PHP commentaire - -- how to comment out PHP code comment faire des observations sur le code PHP - -- commenting out in php commentant en PHP - -- free coments libre coments - -- php comment block of code PHP commentaire bloc de code - -- myspace comment blocks MySpace commentaire blocs - -- coment php Coment PHP - -- php comment blocks PHP commentaire blocs - -- comentário php un commentaire PHP - -- comment blocks for myspace commentaire de blocs MySpace - -- PHP comentario PHP commentaire - -- remark out php remarque sur PHP - -- comment out a block of code in unix commenter un bloc de code sous UNIX - -- como comentar em PHP Como em-vous PHP - -- comentario no php aucun commentaire PHP - -- myspace comment bocks MySpace commentaire bocks - -- php comment out blocks PHP commenter blocs - -- php commenting PHP commentaires - -- php commenting out PHP commentant - -- php comment a block of code php commenter un bloc de code - -- comment out block of php commenter bloc de PHP - -- php comment block PHP commentaire bloc - -- comment block in unix bloc de commentaire sur Unix - -- coment in php Coment en PHP - -- comment blocks on myspace blocs de commentaire sur MySpace - -- hOW TO coment in PHP Comment Coment en PHP - -- "comentario em php" "em commentaire PHP" - -- comentários em php em commentaires PHP - -- comentario en php comentario en PHP - -- php coments code coments code PHP - -- php block of comment PHP bloc de commentaire - -- PHP commenting out a block of code PHP commentant un bloc de code - -- free coments on internet coments gratuitement sur Internet - -- comment block for myspace commentaire bloc de MySpace - -- comentar php PHP-vous - -- comments tag block in pHP Commentaires Tag bloc en PHP - -- italian coments about life italien sur la vie coments - -- PHP + commenting PHP + commentaires - -- norsk comments code Norsk commentaires code - -- comment in PHP commentaire en PHP - --