0PricingLogin
PHP Academy · Lesson

PHP Syntax and Structure

Understand the basic syntax and structure of PHP code.

1

PHP Syntax and Structure

Welcome to the next step in your PHP journey! In this lesson, you’ll learn the foundational syntax and structure of PHP, which will form the backbone of your programming skills. Let’s dive in!

PHP Syntax and Structure — illustration 1

2

PHP Tags

PHP code must be written inside PHP tags. This tells the server where the PHP code starts and ends:

  • <?php is used to open a PHP block.
  • ?> is used to close it.

Tip: PHP can be embedded in HTML or used in standalone files with the .php extension.

<?php
  echo "This is a PHP block!";
?>

All lessons in this course

  1. PHP Syntax and Structure
  2. Embedding PHP in HTML
← Back to PHP Academy