PHP Tutorial
Server-side scripting for the web
Learn PHP with 20 free lessons. Variables, forms, sessions, MySQL integration, and modern PHP 8 features — still powering 75% of the web.
What you'll learn
- PHP syntax
- Forms and POST/GET
- Sessions and cookies
- MySQL with PHP
- Modern PHP 8 features
Prerequisites
- Basic HTML
- A local PHP server (XAMPP / Laravel Valet)
Why learn PHP?
- PHP powers WordPress, Wikipedia, Facebook (originally), Slack
- 75%+ of the web still runs on PHP
- Easiest server-side language to learn first
- Steady demand for full-stack PHP roles in India
Course Curriculum
20 lessons · ~10 hours · self-paced
- 1
Introduction to PHP
What PHP Actually Does
- 2
Installing PHP & Setup
Three Pieces, Not One
- 3
Variables & Data Types
Variables Are Names for Values
- 4
Operators
Arithmetic, and the Parts That Are Not Obvious
- 5
Strings
Single Quotes and Double Quotes Are Not the Same
- 6
Conditionals
if, elseif, else
- 7
Loops
foreach: the Loop You Will Use Most
- 8
Arrays
One Type Doing Two Jobs
- 9
Functions
What a Function Buys You
- 10
Superglobals
The Arrays PHP Fills In For You
- 11
Form Handling
The Shape of a Form-Handling Page
- 12
File Handling
Reading and Writing Whole Files
- 13
Sessions & Cookies
How a Session Actually Works
- 14
Object-Oriented PHP
The Problem Classes Solve
- 15
Inheritance & Interfaces
Inheritance: extends, Overriding and parent::
- 16
Working with MySQL
How PHP Talks to MySQL
- 17
PDO Database Access
Connecting: the DSN and Three Options That Matter
- 18
Error Handling
Warnings, Errors and Exceptions Are Three Different Things
- 19
PHP Best Practices
The Security Rules That Carry the Most Weight
- 20
Final Project: Build a PHP App
What You Are Building
From the Blog
Guides and tutorials related to PHP.
Ready to start?
All 20 lessons are free. No credit card. No sign-up required to read.
Start with lesson 1: Introduction to PHP