Lecture 1 / 12
Lecture 01 ยท Fundamentals

Introduction to PHP & Setup

Beginner ~45 min

What is PHP?

PHP (Hypertext Preprocessor) is a popular server-side scripting language designed for web development. It powers over 75% of websites including WordPress, Facebook, and Wikipedia.

Why PHP?

  • Easy to learn with simple syntax
  • Excellent for building dynamic websites and APIs
  • Strong database integration (MySQL, PostgreSQL, etc.)
  • Fast development with huge ecosystem (Laravel, Symfony)

Setup

Recommended: XAMPP (Windows/Mac/Linux) or Laragon.

info.php
<?php
phpinfo();
?>
๐ŸŽฏ Exercise 1.1

Create hello.php that outputs "Hello, PHP Mastery!" and run it on your local server.

Lecture 02 ยท Fundamentals

Variables & Data Types

Beginner ~45 min

Variables in PHP

PHP variables start with a $ sign.

$name = "John";
$age = 25;
$price = 19.99;
Lecture 03 ยท Fundamentals

Operators & Expressions

Beginner ~40 min

Concatenation

In PHP, we use a dot . to join strings.

echo "Hello " . $name;
Lecture 04 ยท Fundamentals

Control Flow

Beginner ~45 min

If Statements

if ($age >= 18) {
    echo "Adult";
} else {
    echo "Minor";
}
Lecture 05 ยท Fundamentals

Loops

Beginner ~40 min

Foreach Loop

The best way to iterate through arrays in PHP.

$colors = ["red", "green", "blue"];
foreach ($colors as $color) {
    echo $color;
}
Lecture 06 ยท Core Concepts

Functions

Intermediate ~50 min
function sum($a, $b) {
    return $a + $b;
}
Lecture 07 ยท Core Concepts

Arrays & Superglobals

Intermediate ~55 min

Associative Arrays

$person = [
    "name" => "Jane",
    "role" => "Manager"
];
Lecture 08 ยท Core Concepts

Strings & Forms

Intermediate ~45 min

Handling form data with $_POST and $_GET.

Lecture 09 ยท Advanced

Object-Oriented PHP

Advanced ~65 min
class User {
    public $name;
    function __construct($name) { $this->name = $name; }
}
Lecture 10 ยท Advanced

File I/O & Security

Advanced ~50 min

Always sanitize your inputs using htmlspecialchars() to prevent XSS attacks.

Lecture 11 ยท Advanced

MySQL & PDO

Advanced ~60 min

Use PDO with prepared statements for secure database queries.

$stmt = $pdo->prepare('SELECT * FROM users WHERE id = ?');
$stmt->execute([$id]);
Lecture 12 ยท Capstone

Capstone Project: Blog System

Advanced ~180 min

Build a fully functional blog system with user authentication, post creation, and database storage.

// Project requirements:
// 1. Database schema for users and posts
// 2. Login/Register system
// 3. Post CRUD functionality
// 4. File uploads for post images