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 .



2 Responses to “Comments and Comment Blocks in PHP” 2 Responses to "Comentarios y Observaciones bloques en PHP"

  1. E-Volution IT » Blog Archive » Windows Genuine Advantage circumvention E-volución »Blog Archive» Ventajas de Windows Original elusión
    July 26th, 2006 06:45 26 de julio de 2006 06:45
    1

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

  2. How to Comment Code in WordPress Templates Cómo comentar el código en las plantillas de WordPress
    December 10th, 2007 01:30 10 de diciembre de 2007 01:30
    2

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

Leave a Reply Deja Responder

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> Puede usar estos tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q Cite=""> <strike> <strong>

Subscribe without commenting Suscribirse sin comentar


Custom Search

New Articles Nuevos Artículos

Incoming Search Terms for the Article Próximos Términos de búsqueda para el artículo

comment out php comentar PHP - -- php comment out PHP comentar - -- comentario em php comentario em PHP - -- comentário em php comentário em PHP - -- how to comment out php la forma de comentar PHP - -- php coment PHP comentario - -- comentario php PHP comentario - -- comment out in php comentar en PHP - -- php coments PHP comentarios - -- comment out php code comentar código PHP - -- php comment PHP comentario - -- how to comment out PHP code la forma de comentar código PHP - -- php comment blocks PHP comentario bloques - -- myspace comment blocks MySpace comentario bloques - -- commenting out in php comentando en PHP - -- comment blocks for myspace comentario bloques para MySpace - -- free coments libre comentarios - -- php comment block of code PHP comentario bloque de código - -- coment php PHP comentario - -- remark out php observación de PHP - -- comentario no php comentario no PHP - -- comentário php PHP comentário - -- PHP comentario PHP comentario - -- comment out a block of code in unix comentar un bloque de código en unix - -- como comentar em PHP Como comentar em PHP - -- coment in php comentario en PHP - -- myspace comment bocks MySpace comentario bocks - -- hOW TO coment in PHP Cómo comentario en PHP - -- how to comment out in php la forma de comentario en php - -- comment out a block of php comentar un bloque de php - -- php comment out blocks PHP comentar bloques - -- php commenting PHP comentar - -- php Header Comment Blocks PHP cabecera comentario bloques - -- commenting blocks in php comentando los bloques en PHP - -- php commenting out PHP comentando a cabo - -- php comment a block of code php comentar un bloque de código - -- comment out block of php comentar bloque de PHP - -- php comment block PHP comentario bloque - -- comment block in unix comentario de bloque en Unix - -- comment blocks on myspace bloques de comentario en MySpace - -- "comentario em php" "comentario em PHP" - -- comentários em php comentários em PHP - -- how to comment out blocks in php la forma de comentar bloques en php - -- comentario en php comentario en PHP - -- php coments code comentarios código PHP - -- php block of comment PHP bloque de comentario - -- PHP commenting out a block of code PHP comentar un bloque de código - -- free coments on internet libre comentarios en Internet - -- comment block for myspace comentario de bloque para MySpace - -- comentar php comentar PHP - --