Comments and Comment Blocks in PHP Comentarios y Observaciones bloques en PHP
PHP supports C language, C++ programming language and Unix shell-style (Perl style) comments. PHP soporta lenguaje C, C + + lenguaje de programación shell de Unix y de estilo (estilo Perl) comentarios. 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, / / o # se usa para hacer una sola línea de comentario o / * y * / para hacer un gran bloque de comentario que se extiende por varias líneas.
For example: Por ejemplo:
<?php <? PHP
echo ‘This is a test’; //This is a single-line C++ style comment echo 'Esta es una prueba'; / / Se trata de una sola línea de C + + estilo comentario
echo ‘This is another test’;#This is another single-line shell-style comment echo 'Esta es otra prueba "; # Esta es otra línea de un solo estilo de concha comentario
/* This is a multi line comment / * Esta es una línea de multi comentario
Second line of comment */ Segunda línea de comentario * /
?> >
The “one-line” comment styles comment to the end of the line or the current block of PHP code, whichever comes first. El de "una sola línea" comentario estilos comentario al final de la línea o el bloque actual de código PHP, lo que suceda primero. 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. Esto significa que el código HTML después de que el bloque de script PHP (PHP roto con el modo> y vuelve al modo HTML después de fin de bloque de código PHP) será impresa. If the asp_tags configuration directive is enabled, it behaves the same with // %> and # %>. Si la configuración asp_tags directiva está habilitada, se comporta con la misma / /%> #% y>. However, the </script> tag doesn’t break out of PHP mode in a single-line comment. Sin embargo, la </ script> etiqueta no salir del modo PHP en una sola línea de comentario.
For example, Por ejemplo,
<h1>This is an <?php # echo ’simple’;?> example.<h1> <h1> Se trata de una <? php # echo 'simple';?> ejemplo. <h1>
<p>The header above will say ‘This is an example’.</p> <p> La cabecera de arriba dicen 'Este es un ejemplo ». </ p>
C or C++ style comments end at the first */ encountered. C o C + + estilo observaciones finales en la primera * / encontrado. 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. Cualquier anidado / * y * / estilo de comentarios causa de error, y es bastante fácil de hacer de este error si está tratando de comentar un gran bloque de código.
<?php <? PHP
/* / *
echo ‘This is a test’; /* This comment will cause a problem */ echo 'Esta es una prueba'; / * Este comentario causará un problema * /
*/ * /
?> >
The PHP comments is useful when you want to comment or disable a large portion of HTML. Los comentarios de PHP es útil cuando usted desea hacer comentarios o desactivar una gran parte de 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 */. En lugar de comentar el código HTML línea por línea, poner todo el HTML bloque en bloque de código PHP (es decir, añadir <? Php y?>) Y comentar con / * y * /.
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANTE: Se trata de una máquina que traduzca la página se proporciona "tal cual" sin garantía. Machine translation may be difficult to understand. La traducción automática puede resultar difícil de entender. Please refer to Por favor, consulte original English article artículo original Inglés whenever possible. siempre que sea posible.
Share and contribute or get technical support and help at Compartir y contribuir o recibir apoyo técnico y ayudar a My Digital Life Forums Mi vida digital Foros .
Related Articles Artículos relacionados
- 3 Column Relaxation WordPress Theme comments-paged.php for Paged-Comments WordPress Plugin Columna 3 Relajación WordPress-Tema comentarios paged.php para Paged-Comentarios WordPress Plugin
- Fight and Stop Comment Spam and Trackback Spam with Akismet Luchar y parar los comentarios no deseados y trackback spam con Akismet
- Integrate WordPress including Comments with bbPress Forum using bbSync Integrar la inclusión de los comentarios de WordPress con bbPress Foro utilizando bbSync
- PHP Parse Error: syntax error, unexpected $end PHP Parse error: error de sintaxis, $ final inesperado
- How to Add and Put Picture or Image in MySpace Comment Cómo agregar y poner la imagen fotográfica o en MySpace Comentario
- Reduce Server Load Using Akismet to Automatically Discard Spam Comments on Posts Older than A Month Reducir la carga del servidor usando Akismet para descartar automáticamente spam los comentarios sobre los puestos de más de un mes
- Free Download: Akismet for WordPress Plugin 2.0 to Stop Comment, Trackback and Pingback Spam Descarga gratuita: Akismet para WordPress 2,0 plugin para Detener comentario, pingback y Trackback Spam
- Stop Comment, Pingback and Trackback Spam with New Version of Akismet Stop comentario, pingback y Trackback Spam con Nueva Versión del Akismet
- WordPress 2.2 Released for Free Download WordPress 2,2 despachadas a libre descarga
- Symantec Norton Internet Security 2009’s Official Release Symantec Norton Internet Security 2009 del lanzamiento oficial

































July 26th, 2006 06:45 26 de julio de 2006 06:45
[...] http://www.mydigitallife.info/2006/04/26/dis… . [...]
December 10th, 2007 01:30 10 de diciembre de 2007 01:30
[...] tip of the hat to My Digital Life for his article - Comments and Comment Blocks in PHP. [...] Punta del sombrero en Mi vida digital de su artículo - Comentarios y Observaciones bloques en PHP. By Alec Tags: [...] Por Alec Tags: [...]