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!
This posts may be interesting too
Related posts:
- php beginner guide: introduction to php Well.. Here we are with this first chapter of a...
- 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.
Hi! Welcome and Thanks for your visit! My name is Antonio and I'm web designer, blogger, Seo, and other more.... Feel free to add my like friend in: 















Di PHP non capisco un’acca, ma almeno questa parte l’ho capita, rifacendomi al codice smincio di WP.
Grazie =)
PhP non è poi cosi complicato come sembra, al contrario è molto più semplice di tanti altri linguaggi.
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 =)
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.
Excelente post!! Me gustaria mucho que sigas con la serie, estoy en esto de aprender PHP.
Saludos desde Chile!
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!
9cSgXV Thank you for the material. Do you mind if I posted it in her blog, of course, with reference to your site?