PHP theorytheory 0/50 · 0%
Fundamentals · easy

1. PHP Basics & Syntax

How PHP scripts are structured.

PHP code lives inside <?php ... ?> tags and is typically embedded in files with a .php extension. Statements end with a semicolon, and PHP is a loosely typed, interpreted language executed on the server before HTML is sent to the browser.

Modern PHP (8.x) encourages omitting the closing ?> tag in pure-PHP files to avoid accidental whitespace output.

Check your understanding

  1. 1. How does a PHP statement typically end?

  2. 2. What opens a block of PHP code?