PHP Web Development

PHP Web Development

The language behind a large share of the web's backends -- request handling, arrays, OOP, Composer, and basic web-security practices.

beginner12 lessons4 modules6h total

Who it's for

Learners with some prior programming experience who want a practical introduction to PHP for web backends.

What you'll be able to do

  • Read and predict the behavior of real PHP programs covering variables, arrays, and control flow
  • Explain PHP's request-response model, superglobals, and object-oriented features (interfaces, traits, namespaces)
  • Identify basic web-security practices PHP code should follow (prepared statements, output escaping)

Not started — 12 lessons, no account required.

Start this course

Practice this course →Add to a study plan →Interview questions

PHP Fundamentals

The request-response model, variables and interpolation, and control flow.

  1. Introduction to PHP and the Request-Response Model

    What PHP is, how a .php file handles a web request, and embedding PHP in HTML.

    15 min
  2. Variables, Types, and String Interpolation

    PHP's `$variable` syntax, loose typing, and interpolating values into strings.

    18 min
  3. Control Flow: if, foreach, while, and match

    PHP's conditionals and loops, plus PHP 8's more precise `match` expression.

    18 min

Functions & Arrays

Functions and arguments, PHP's list-and-map arrays, and superglobals.

  1. Functions, Default Arguments, and Named Arguments

    Declaring functions with typed parameters, default values, and PHP 8 named arguments.

    18 min
  2. PHP Arrays: List and Map in One

    PHP's single array type, which doubles as both an ordered list and a string-keyed map.

    20 min
  3. Superglobals: $_GET, $_POST, and $_SERVER

    How PHP exposes incoming request data through built-in superglobal arrays.

    18 min

OOP in PHP

Classes and objects, interfaces and traits, and namespaces/autoloading.

  1. Classes and Objects

    Defining a PHP class with typed properties and methods, and creating instances.

    20 min
  2. Interfaces and Traits

    Defining a contract with an interface, and sharing behavior across classes with traits.

    20 min
  3. Namespaces and Autoloading

    Organizing classes with namespaces, and the PSR-4 convention that autoloads them.

    15 min

Modern PHP Practices

Composer and package management, error handling, and security basics.

  1. Composer and Package Management

    How composer.json declares dependencies and autoloading rules for a PHP project.

    15 min
  2. Error and Exception Handling

    PHP's try/catch/finally, throwing exceptions, and how PHP's error model has evolved.

    18 min
  3. Security Basics: SQL Injection and XSS

    Preventing SQL injection with prepared statements, and XSS with output escaping.

    20 min