AgerNic.com/ro
WEB DEVELOPER SITE, HTML, CSS, PHP, SQL
Tutorial

Tutorial PHP» Comentarii

Comentariile în PHP nu sunt executate de interpretul PHP, ci în schimb sunt ignorate de acesta. Ele servesc programatorilor pentru a face mai u?or de în?eles codul. Pute?i, dup? cum spune ?i numele, s? comenta?i codul programului dvs., adic? s? explica?i ce func?ii au sec?iunile individuale ale programului.

Definirea comentariilor în PHP
Pentru a insera un comentariu într-un script PHP, pute?i utiliza fie dou? bare // sau un diez # la inceputul fiecarei linii, sau unul dintre aceste dou? caractere daca apare în codul programului dvs., restul con?inutului liniei va fi omis, iar interpretul PHP va trece la linia urm?toare.

Example comentarii in PHP

Syntax for single-line comments:

<!DOCTYPE html>
<html>
<body>
<?php
// This is a single-line comment
# This is also a single-line comment
?>

</body>
</html>

Comentarii cu mai multe linii
Uneori, are sens s? ai un comentariu pe mai multe rânduri, de exemplu dac? programatorul ar dori s? comenteze o sec?iune de program.
Un astfel de comentariu începe cu / * ?i se termin? cu * /:

Exemplu:
Sintaxa pentru comentarii cu mai multe linii:

<!DOCTYPE html>
<html>
<body>

<?php
/*
Acesta este un bloc de comentarii cu mai multe rânduri
care se întinde pe multiple
linii
*/ echo "Acesta a fost un exemplu pentru un comentariu pe mai multe linii";
?>

</body>
</html>

Exemplu
Folosind comentarii pentru a l?sa p?r?i din cod:


<!DOCTYPE html>
<html>
<body>

<?php
// You can also use comments to leave out parts of a code line
$x = 5 /* + 15 aici este un comentariu */ + 5;
echo $x;
?>

</body>
</html>
Tags: Comentarii in PHP, Exemple, Cursuri web design online gratis.

Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


analytics piwika