PHP Tutorial
Learn PHP step by step through 91 structured lessons. The course starts with essential concepts and progresses toward practical, advanced topics, with explanations, syntax, examples, common mistakes and exercises you can try yourself.
- Level: Beginner to advanced
- Format: 91 free, self-paced lessons
- Best for: Students, career changers and developers refreshing their skills
What You Will Learn
This learning path covers the following areas in curriculum order:
- PHP Tutorial
- PHP Fundamentals
- PHP Strings
- PHP Control Flow
- PHP Arrays
- PHP Functions
- PHP OOP
- PHP Superglobals & Forms
- PHP File Handling
- PHP Error Handling & Debugging
- PHP Database (MySQL/PDO)
- PHP Security
- PHP Modern Features
- PHP Composer & Autoloading
- PHP Reference
Who This Course Is For
This tutorial is suitable for complete beginners as well as learners who already know some programming and want a structured reference. Start from the first lesson if the subject is new to you. Experienced learners can use the curriculum below to jump directly to a specific concept.
How to Use This Tutorial
- Read each lesson in curriculum order and run every example yourself.
- Change the examples to test your understanding instead of only copying them.
- Complete the exercises and review the common-mistake sections before moving on.
- Bookmark this course page so you can return to the complete lesson index.
Course Contents
PHP Tutorial
PHP Fundamentals
PHP Strings
PHP Control Flow
- PHP If Else
- PHP Switch
- PHP match Expression
- PHP While Loop
- PHP For Loop
- PHP foreach Loop
- PHP Break Continue
PHP Arrays
- PHP Indexed Arrays
- PHP Associative Arrays
- PHP Multidimensional Arrays
- PHP Array Functions
- PHP Array Destructuring (list())
- PHP Sorting Arrays
PHP Functions
- PHP Functions
- PHP Function Arguments
- PHP Default Arguments
- PHP Variadic Functions
- PHP Return Types
- PHP Anonymous Functions
- PHP Arrow Functions (fn)
- PHP Closures
- PHP Recursion
PHP OOP
- PHP OOP Introduction
- PHP Classes Objects
- PHP Properties and Methods
- PHP Constructors
- PHP The $this Keyword
- PHP public, private, and protected
- PHP Inheritance
- PHP Abstract Classes
- PHP Interfaces
- PHP Traits
- PHP Static Properties and Methods
- PHP Magic Methods (__construct, __toString, etc.)
- PHP Namespaces
- PHP Enums
PHP Superglobals & Forms
- PHP $_GET and $_POST
- PHP $_REQUEST and $_SERVER
- PHP Forms Handling
- PHP Form Validation
- PHP Sessions
- PHP Cookies
PHP File Handling
PHP Error Handling & Debugging
- PHP Errors, Warnings, and Notices
- PHP Exceptions
- PHP Try Catch Finally
- PHP Custom Exceptions
- PHP Debugging
PHP Database (MySQL/PDO)
- PHP Introduction to PDO
- PHP Connecting with PDO
- PHP PDO SELECT Queries
- PHP PDO INSERT, UPDATE, DELETE
- PHP Prepared Statements
- PHP MySQLi Basics
PHP Security
- PHP Sql Injection Prevention
- PHP Xss Prevention
- PHP Password Hashing
- PHP Input Sanitization
- PHP Csrf Protection
PHP Modern Features
- PHP Null Coalescing Operator (?? and ??=)
- PHP Nullsafe Operator (?->)
- PHP Named Arguments
- PHP readonly Properties
- PHP First-Class Callable Syntax
- PHP Attributes
PHP Composer & Autoloading
PHP Reference
Frequently Asked Questions
Is this PHP tutorial free?
Yes. The lessons listed on this page are free to read and can be completed at your own pace.
Do I need previous experience?
No previous experience is required for the introductory lessons. Some advanced modules are easier if you first complete the fundamentals in this course.
How should I practise?
Type and run the examples, deliberately change their inputs, predict the result before execution and build a small project after completing each major section.
