All paths
PHPBeginner

PHP

Learn PHP from scratch: the language that powers much of the web (WordPress, Laravel, millions of sites). Real executable code, run on the server with PHP 8.

17 chapters68 lessons99 challenges

Course curriculum

Chapter 1: Introduction to PHP

  • PHP and where it's used
  • echo and output
  • Comments
  • How PHP runs

Chapter 2: Variables and types

  • Variables
  • Types and var_dump
  • Constants
  • Type juggling

Chapter 3: Strings

  • Concatenation
  • Interpolation
  • String functions
  • Splitting and joining

Chapter 4: Control flow

  • if, elseif, else
  • switch and match
  • Ternary and null coalescing
  • == versus ===

Chapter 5: Loops

  • for
  • while and do-while
  • foreach
  • break and continue

Chapter 6: Arrays

  • Indexed arrays
  • Associative arrays
  • Array functions
  • Iterating associatives

Chapter 7: Functions

  • Defining a function
  • Parameters and types
  • Scope
  • Functions and arrays

Chapter 8: Advanced arrays and functions

  • array_map
  • array_filter
  • array_reduce and array_sum
  • Anonymous and arrow functions

Chapter 9: Classes and objects

  • Defining a class
  • The constructor
  • Visibility
  • Instance methods

Chapter 10: Inheritance and polymorphism

  • Inheritance
  • override and parent
  • Abstract classes
  • Polymorphism

Chapter 11: Interfaces

  • What an interface is
  • Polymorphism with interfaces
  • Implementing multiple interfaces
  • Interface or abstract class

Chapter 12: Traits, namespaces and enums

  • Traits
  • Namespaces
  • Enums
  • Backed enums and methods

Chapter 13: PHP for the web

  • Request and response
  • $_GET and $_POST
  • Sessions and cookies
  • Never trust input

Chapter 14: JSON and data

  • json_encode
  • json_decode
  • Working with data
  • Nested structures

Chapter 15: Databases with PDO

  • Connecting with PDO
  • Reading data
  • Prepared statements
  • SQL injection

Chapter 16: Error handling

  • try / catch
  • finally
  • throw
  • Good practices

Chapter 17: Modern PHP and interview

  • Named arguments
  • readonly and nullsafe
  • Other PHP 8 features
  • Interview ready

Ready to level up?

Create a free account and start now: earn XP on every challenge and climb the leaderboard.

PHP — LevelUpCode