Free curriculum

Learn PHP, lesson by lesson

Follow a modern server-side PHP path from syntax and collections to objects, databases, forms, security, Composer, queues, caching, APIs, and deployment.

Core language skills lead into request-oriented web development, then framework, testing, performance, and production delivery concerns.

25 lessonsAbout 587 minutesThe runner executes modern PHP with the PHP command-line interpreter in a server sandbox.

Complete curriculum

Work in order, or open any lesson as a public reading reference. Interactive practice remains optional.

  1. Lesson 1 · basics

    Introduction to PHP

    Start learning PHP from scratch. Understand why PHP powers millions of websites and write your first server-side script.

    Read lesson →
    Position
    core · 12 min
    Prerequisites
    None
    Outcomes
    Syntax Fluency
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  2. Lesson 2 · basics

    Variables and Data Types

    Learn PHP variables and data types including strings, integers, floats, booleans, and type casting for type-safe PHP development.

    Read lesson →
    Position
    core · 18 min
    Prerequisites
    Introduction to PHP
    Outcomes
    Syntax Fluency
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  3. Lesson 3 · basics

    Functions

    Learn PHP functions with typed parameters, return types, closures, and arrow functions. Build reusable code blocks for any project.

    Read lesson →
    Position
    core · 18 min
    Prerequisites
    Introduction to PHP, Variables and Data Types
    Outcomes
    Syntax Fluency
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  4. Lesson 4 · basics

    Control Flow

    Learn PHP control flow with if/else, switch, match expressions, and loops. Build programs that make decisions and iterate over data.

    Read lesson →
    Position
    core · 18 min
    Prerequisites
    Introduction to PHP, Variables and Data Types, Functions
    Outcomes
    Syntax Fluency
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  5. Lesson 5 · basics

    Arrays and Objects

    Master PHP arrays and objects for organizing complex data. Learn indexed arrays, associative arrays, array_map, filter, and reduce.

    Read lesson →
    Position
    core · 22 min
    Prerequisites
    Introduction to PHP, Variables and Data Types, Functions, Control Flow
    Outcomes
    Data Modeling, Abstraction & Design
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  6. Lesson 6 · intermediate

    OOP and Classes

    Master PHP object-oriented programming with classes, inheritance, abstract classes, interfaces, and constructor promotion.

    Read lesson →
    Position
    core · 22 min
    Prerequisites
    Introduction to PHP, Variables and Data Types, Functions
    Outcomes
    Abstraction & Design
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  7. Lesson 7 · intermediate

    Error Handling

    Learn PHP error handling with try/catch/finally, custom exception classes, and error reporting for production-ready applications.

    Read lesson →
    Position
    core · 20 min
    Prerequisites
    Functions, Control Flow
    Outcomes
    Architecture & Maintainability, Security & Robustness
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  8. Lesson 8 · intermediate

    Working with Databases

    Connect to databases with PHP PDO. Learn CRUD operations, prepared statements, parameter binding, and transactions for safe data access.

    Read lesson →
    Position
    core · 25 min
    Prerequisites
    Functions, OOP and Classes
    Outcomes
    Security & Robustness, Data Modeling
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  9. Lesson 9 · intermediate

    File Handling

    Learn PHP file handling to read, write, and manage files and directories. Process CSV uploads, handle file streams, and manage paths.

    Read lesson →
    Position
    core · 20 min
    Prerequisites
    Functions, Error Handling
    Outcomes
    Security & Robustness, Data Modeling
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  10. Lesson 10 · intermediate

    Sessions and Cookies

    Manage user state with PHP sessions and cookies. Build login systems, shopping carts, and flash messages across HTTP requests.

    Read lesson →
    Position
    core · 22 min
    Prerequisites
    Arrays and Objects, OOP and Classes
    Outcomes
    Security & Robustness, Architecture & Maintainability
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  11. Lesson 11 · advanced

    Laravel Basics

    Get started with Laravel, PHP's most popular framework. Learn routing, controllers, Blade templates, and Eloquent ORM basics.

    Read lesson →
    Position
    core · 28 min
    Prerequisites
    OOP and Classes, Working with Databases
    Outcomes
    Architecture & Maintainability, Abstraction & Design
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  12. Lesson 12 · advanced

    API Development

    Build RESTful APIs with PHP using proper HTTP methods, JSON responses, request routing, and input validation patterns.

    Read lesson →
    Position
    core · 25 min
    Prerequisites
    OOP and Classes, Error Handling
    Outcomes
    Architecture & Maintainability, Security & Robustness
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  13. Lesson 13 · advanced

    Authentication and Security

    Implement secure PHP authentication with password hashing, CSRF protection, XSS prevention, and SQL injection defense.

    Read lesson →
    Position
    core · 25 min
    Prerequisites
    Working with Databases, Sessions and Cookies
    Outcomes
    Security & Robustness, Architecture & Maintainability
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  14. Lesson 14 · advanced

    Deployment

    Deploy PHP applications to production. Learn Composer autoloading, environment config, PHP-FPM, nginx, error logging, and opcache.

    Read lesson →
    Position
    core · 22 min
    Prerequisites
    OOP and Classes, Error Handling
    Outcomes
    Production Delivery, Performance & Runtime
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  15. Lesson 15 · advanced

    Capstone Project: Blog System

    Build a complete blog system with PHP combining authentication, CRUD operations, SQLite database, templates, and a REST API.

    Read lesson →
    Position
    core · 35 min
    Prerequisites
    Working with Databases, Sessions and Cookies, API Development
    Outcomes
    Architecture & Maintainability, Security & Robustness, Data Modeling
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  16. Lesson 16 · intermediate

    String Manipulation

    Master PHP string functions for searching, formatting, transforming, and parsing text data in web applications.

    Read lesson →
    Position
    core · 25 min
    Prerequisites
    Variables and Data Types, Functions, Arrays and Objects
    Outcomes
    Syntax Fluency, Data Modeling
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  17. Lesson 17 · intermediate

    PHP 8 Features

    Explore PHP 8 features including match expressions, named arguments, union types, nullsafe operator, and constructor promotion.

    Read lesson →
    Position
    core · 25 min
    Prerequisites
    Variables and Data Types, Functions, Arrays and Objects, OOP and Classes
    Outcomes
    Syntax Fluency
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  18. Lesson 18 · basics

    Composer And Packages

    Learn Composer, PHP's dependency manager. Install packages, manage versions, configure autoloading, and structure modern PHP projects.

    Read lesson →
    Position
    core · 25 min
    Prerequisites
    Variables and Data Types, Functions, Arrays and Objects, OOP and Classes
    Outcomes
    Architecture & Maintainability
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  19. Lesson 19 · intermediate

    Testing With Phpunit

    Learn PHP testing with PHPUnit. Write test classes, use assertions, data providers, and mocking for reliable, maintainable code.

    Read lesson →
    Position
    core · 25 min
    Prerequisites
    Variables and Data Types, Functions, Error Handling, Composer And Packages
    Outcomes
    Testing & Debugging
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  20. Lesson 20 · advanced

    Design Patterns

    Learn classic design patterns in PHP including Singleton, Factory, Observer, and Strategy with practical, real-world examples.

    Read lesson →
    Position
    core · 27 min
    Prerequisites
    Variables and Data Types, Functions, OOP and Classes, OOP and Classes, Composer And Packages
    Outcomes
    Abstraction & Design, Architecture & Maintainability
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  21. Lesson 21 · intermediate

    Form Processing

    Learn safe PHP form processing. Read input data, sanitize and validate user submissions, and return meaningful error messages.

    Read lesson →
    Position
    core · 25 min
    Prerequisites
    Variables and Data Types, String Manipulation, PHP 8 Features
    Outcomes
    Security & Robustness
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  22. Lesson 22 · intermediate

    Templating And Views

    Separate PHP logic from HTML with templating patterns. Build reusable layouts, partials, and a minimal template engine from scratch.

    Read lesson →
    Position
    core · 25 min
    Prerequisites
    Variables and Data Types, String Manipulation, Form Processing
    Outcomes
    Abstraction & Design, Security & Robustness
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  23. Lesson 23 · advanced

    Queues And Jobs

    Implement background job queues in PHP with job interfaces, workers, retry logic, and priority scheduling for async task processing.

    Read lesson →
    Position
    core · 25 min
    Prerequisites
    Variables and Data Types, Functions, Design Patterns, Composer And Packages
    Outcomes
    Performance & Runtime, Architecture & Maintainability
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  24. Lesson 24 · advanced

    Caching And Performance

    Learn PHP caching strategies from in-memory arrays to file-based caches. Master TTL expiration, cache invalidation, and profiling.

    Read lesson →
    Position
    core · 25 min
    Prerequisites
    Variables and Data Types, Functions, Design Patterns, Composer And Packages
    Outcomes
    Performance & Runtime, Architecture & Maintainability
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.
  25. Lesson 25 · advanced

    Rest Api Best Practices

    Design production-grade REST APIs in PHP with consistent response structures, proper HTTP semantics, error handling, and versioning.

    Read lesson →
    Position
    core · 28 min
    Prerequisites
    Variables and Data Types, Functions, Design Patterns, Form Processing, Composer And Packages
    Outcomes
    Architecture & Maintainability, Security & Robustness
    Runtime / version
    The runner executes modern PHP with the PHP command-line interpreter in a server sandbox.