Php Beginner guide : The comments

The comments in php are a really important phase of the programming, because they will help you, or other programmer, when you’ll come back to write on the same code after a long time.

An important thing to know is  that their use does not weigh the execution of the script (the PHP interpreter jumps all parties recognizing that comment), or the transfer of the page to the browser (in fact the comments, as contained within the PHP code, are part of what is not sent to the browser).

In php we have the same comments use in the major programming languages, like c++ or python, here some examples :

<?php

// comment style c++

?>

<?php

# comment style python

?>

This kind of comments are only on one line, when the PHP interpreter found this comments jump this part and go directly to the source php code.

But we can also use comments on more than one lines, like this :

<?php

/* this is a comment

on multilines

*/

?>

Be sure that don’t make error when you write a comment, or this will affect your code.

<?php

*/ this is a erroneus comment

*/

?>

<?php

/* this is the correct

way to comment on mutlilines

*/

?>

Simply not? The next time i will start writing code for php, stay tuned!

Related posts:

  1. php beginner guide: introduction to php Well.. Here we are with this first chapter of a...
  2. Detect the user’s browser with javascript A big and boring problem for the designers is the...

Related posts brought to you by Yet Another Related Posts Plugin.

If you liked this post , consider to subscribe to the Rss.

7 Responses to “Php Beginner guide : The comments”

  1. Cle` says:

    Di PHP non capisco un’acca, ma almeno questa parte l’ho capita, rifacendomi al codice smincio di WP.

    Grazie =)

  2. admin says:

    PhP non è poi cosi complicato come sembra, al contrario è molto più semplice di tanti altri linguaggi.
    :)

  3. Cle` says:

    Ne sono certa, ma ho una qualche antipatia di fondo per PHP, ho cominciato il “Black Book” ma e’ troppo “logico” per me, che con la logica non ci vado d’accordo nemmeno per sbaglio =)

  4. I am trying to learn php via. w3schools, but understanding the concepts from there is quite difficult, i am happy to know about last web desigener to reinvent my learning experience.

  5. Esteban says:

    Excelente post!! Me gustaria mucho que sigas con la serie, estoy en esto de aprender PHP.

    Saludos desde Chile!

  6. admin says:

    Hola Esteban, gracias!
    Estoy entendando de volver a escribir en el blog, en unas semana quiero volver a escribir post y seguir tambièn con esa guia :)
    hasta pronto!

  7. Cialis says:

    9cSgXV Thank you for the material. Do you mind if I posted it in her blog, of course, with reference to your site?

Leave a Reply

Security Code: