Course Content
About Lesson

Syntax & Comments

  • PHP code is written inside:
<?php
// your code
?>
  • PHP statements end with a semicolon (;).
PHP
<?php
echo "This is PHP!"; // statement ends with ;
?>
// This is a single-line comment
# This is also a single-line comment
/*
This is a
multi-line comment
*/
PHP
<?php
// Printing a message
echo "Hello World!";

/* Multiple line comment
   explaining the below line */
echo "Learning PHP is fun!";
?>