The web's workhorse

PHP

PHP is a server-side language that powers a large share of the web, from WordPress and Laravel applications to plain templated sites and JSON APIs, and it runs anywhere a web host does. This curriculum starts with the syntax, types, loops, functions and arrays you need for any script, moves on to strings, associative arrays, sorting and classes, and finishes with exceptions and JSON handling, the two skills every real PHP backend depends on. Every example is verified against PHP 8.4, and every exercise reads standard input and prints to standard output, so what you write here works unchanged on the command line.

Beginner-friendlyExamples verified with PHP 8.4
lessons
9 lessons
exercises
14 exercises
interview questions
12 interview questions

What PHP is used for

  • Web backends
  • Content management systems
  • E-commerce
  • APIs

How examples are checked

Every example and every exercise solution was run with PHP 8.4 at build time. In-browser execution for PHP is not available yet; the pages say so rather than pretending.

Learn

The PHP learning path

Read in order: each lesson leans only on the ones before it. Every lesson ends with a small program to write and links to matching exercises.

See the full curriculum with descriptions →

Practice

Practise PHP

14 exercises across 10 topics, each checked by running your program against test cases. Start with these:

All PHP exercises

More

Go further