Overview
PHP is a general-purpose scripting language especially suited to web development. It powers over 75% of websites whose server-side language is known, including WordPress, Wikipedia, and Facebook. Modern PHP (8.x) has evolved significantly with typed properties, match expressions, fibers, enums, and readonly classes.
Key Features
- Web-native — Built specifically for server-side HTML generation
- Modern type system — Union types, intersection types, enums (PHP 8.x)
- Composer — Mature dependency manager with Packagist repository
- Frameworks — Laravel, Symfony, and many more
- Massive deployment — Runs on virtually any hosting provider
Code Example
php
Learning Resources
Learning Path
15 topics across 4 sections
1Basics
- Introduction to PHP — PHP tags, embedding in HTML, and server-side execution
- Variables & Types — Dynamic typing, type juggling, strict_types, and constants
- Strings & Arrays — String functions, array functions, and array manipulation
- Control Flow — if/elseif, switch, match (8.0+), for, foreach, while
- Functions — Named and anonymous functions, closures, arrow functions (fn)
2OOP
- Classes & Objects — Properties, methods, constructors, and access modifiers
- Interfaces & Traits — Contracts, horizontal code reuse, and multiple trait use
- Modern PHP (8.x) — Enums, readonly classes, fibers, and named arguments
- Type System — Union types, intersection types, and typed properties
3Web & Database
- Forms & Sessions — $_GET, $_POST, sessions, cookies, and CSRF protection
- PDO & Database — Prepared statements, transactions, and database abstraction
- REST APIs — JSON handling, request routing, and API design