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.
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 coursePractice this course →Add to a study plan →Interview questions →
PHP Fundamentals
The request-response model, variables and interpolation, and control flow.
- 15 min
Introduction to PHP and the Request-Response Model
What PHP is, how a .php file handles a web request, and embedding PHP in HTML.
- 18 min
Variables, Types, and String Interpolation
PHP's `$variable` syntax, loose typing, and interpolating values into strings.
- 18 min
Control Flow: if, foreach, while, and match
PHP's conditionals and loops, plus PHP 8's more precise `match` expression.
Functions & Arrays
Functions and arguments, PHP's list-and-map arrays, and superglobals.
- 18 min
Functions, Default Arguments, and Named Arguments
Declaring functions with typed parameters, default values, and PHP 8 named arguments.
- 20 min
PHP Arrays: List and Map in One
PHP's single array type, which doubles as both an ordered list and a string-keyed map.
- 18 min
Superglobals: $_GET, $_POST, and $_SERVER
How PHP exposes incoming request data through built-in superglobal arrays.
OOP in PHP
Classes and objects, interfaces and traits, and namespaces/autoloading.
- 20 min
Classes and Objects
Defining a PHP class with typed properties and methods, and creating instances.
- 20 min
Interfaces and Traits
Defining a contract with an interface, and sharing behavior across classes with traits.
- 15 min
Namespaces and Autoloading
Organizing classes with namespaces, and the PSR-4 convention that autoloads them.
Modern PHP Practices
Composer and package management, error handling, and security basics.
- 15 min
Composer and Package Management
How composer.json declares dependencies and autoloading rules for a PHP project.
- 18 min
Error and Exception Handling
PHP's try/catch/finally, throwing exceptions, and how PHP's error model has evolved.
- 20 min
Security Basics: SQL Injection and XSS
Preventing SQL injection with prepared statements, and XSS with output escaping.