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 .
Related Articles Articles connexes
- 3 Column Relaxation WordPress Theme comments-paged.php for Paged-Comments WordPress Plugin Colonne 3 Détente WordPress-Thème commentaires paged.php pour Paged-Commentaires Plugin WordPress
- Fight and Stop Comment Spam and Trackback Spam with Akismet Lutte et d'arrêter le spam et les commentaires trackback spam avec Akismet
- Integrate WordPress including Comments with bbPress Forum using bbSync Intégrer WordPress y compris les observations avec l'aide de bbPress Forum bbSync
- PHP Parse Error: syntax error, unexpected $end PHP Parse error: syntax error, unexpected $ end
- How to Add and Put Picture or Image in MySpace Comment Comment ajouter et mettre l'image ou l'image dans un commentaire MySpace
- Reduce Server Load Using Akismet to Automatically Discard Spam Comments on Posts Older than A Month Réduire la charge du serveur en utilisant Akismet automatiquement à jeter spam des commentaires sur les postes de plus de un mois
- Free Download: Akismet for WordPress Plugin 2.0 to Stop Comment, Trackback and Pingback Spam Téléchargement gratuit: Akismet Plugin pour WordPress 2,0 pour mettre fin à un commentaire, Trackback et Pingback Spam
- Stop Comment, Pingback and Trackback Spam with New Version of Akismet Commentaire d'arrêt, Trackback et Pingback Spam avec la Nouvelle Version du Akismet
- WordPress 2.2 Released for Free Download WordPress 2,2 Paru en téléchargement gratuit
- Rapid Leech Download from RapidShare, MegaUpload, Uploading, MyTempDir and Other File Sharing Services to Server Télécharger Leech rapide de RapidShare, MEGAUPLOAD, Transfert, MyTempDir et autres services de partage de fichiers sur le serveur










July 26th, 2006 06:45 Juillet 26th, 2006 06:45
[...] http://www.mydigitallife.info/2006/04/26/dis… . [...]
December 10th, 2007 01:30 Décembre 10th, 2007 01:30
[...] 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: [...]