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!

2
PHP Tags
PHP code must be written inside PHP tags. This tells the server where the PHP code starts and ends:
<?phpis 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
- PHP Syntax and Structure
- Embedding PHP in HTML