PHP course

What lives here

One unbroken chain: every page ends with a link to the next one, so you can read the course start to finish without ever wondering where to click. The course is grouped into chapters, and each chapter opens with a page that lists its lessons, one line on each. Every lesson teaches one idea with runnable PHP 8.5 examples, and the longer deep dives live on their own pages across Development with PHP:

  1. Start here: What is PHP and where it runs — the first lesson of the first chapter, and the start of the chain.
  2. Values and control flow: variables, types, strings, numbers, operators, conditions, match, ternary and loops.
  3. Arrays, functions and code organisation: the two array kinds, functions, scope, includes, namespaces, Composer.
  4. Everyday library and objects: string functions, dates, JSON, files, errors, then OOP from classes to generators.
  5. The web: forms, HTTP, cookies, sessions, login, a JSON endpoint, PDO, uploads.
  6. Quality, depth and delivery: linters, debugging, the modern PHP tour, the PHP 8.5 highlights, the standard library and the object model in depth, security, patterns and the capstone.

PHP 8.5 goes on the machine with the install lesson or in a Docker container, and the PHP 8.5 in Docker page has the image and the commands. Each system has a page of its own: Windows 11, Ubuntu, Rocky Linux, macOS and FreeBSD.

How to use this course

Type every example, do not just read it. Run each snippet with php before moving on - the course assumes your hands remember the first script by the time the objects arrive.

Stuck on an error message? Every debugging lesson points at PHP errors: case studies, real failures with real fixes from this site.

Lessons

Click a chapter of the course to open or close its lessons.