A free, beginner-friendly PHP course: 20+ hands-on lessons from "Hello World" to secure login systems and MySQL CRUD — no frameworks, just core PHP.
⭐ If these lessons help you learn or teach PHP, please star the repo — it helps other beginners find it.
Jump to: Lessons · Quick start · Guides · Full 45-day plan · Contributing
- Beginners who know basic HTML and want to learn backend development
- Teachers looking for a ready-made, day-by-day PHP curriculum
- Developers who want to understand core PHP before jumping into Laravel
Every lesson folder has its own README.md explaining the concept, plus runnable example files.
git clone https://github.com/kirangautam45/core-php.git
cd core-php/01-hello-world
php -S localhost:8000Open http://localhost:8000 in your browser. For the database lessons (Day 16+), follow MYSQL_SETUP.md first.
| Guide | What it covers |
|---|---|
| php-learning-plan.md | The full 45-day plan with daily topics |
| MYSQL_SETUP.md | Installing and configuring MySQL |
| DATABASE_SETUP.md | Creating the databases used in the lessons |
| SQL_BEGINNERS_GUIDE.md | SQL basics for beginners: databases, tables and CRUD queries |
| GIT-GUIDE.md | Everyday Git commands: setup, commits, branches |
| code-review-template.md | Code review assessment for grading student projects |
- ✅ 01 - Hello World
- ✅ 02 - Variables & Data Types
- ✅ 03 - Operators & Conditionals
- ✅ 04 - Loops
- ✅ 05 - Arrays
- ✅ 06 - Functions
- ✅ 07 - Built-in Functions
- ✅ 08 - Forms & GET/POST
- ✅ 09 - Form Validation
- ✅ 10 - Form Project
- ✅ 11 - File Handling
- ✅ 12 - File Upload
- ✅ 13 - Sessions & Cookies
- ✅ 14 - Password Hashing
- ⬜ 15 - Login System (Student Task)
- ✅ 16 - Database Basics
- ✅ 17 - SQL CRUD
- ✅ 18 - PHP-MySQL Connection
- ✅ 19 - Insert Data
- ✅ 20 - Fetch Data
| Phase | Days | Topics |
|---|---|---|
| Phase 1 | 1-10 | PHP Fundamentals |
| Phase 2 | 11-15 | Files & Sessions |
| Phase 3 | 16-25 | MySQL + PHP |
| Phase 4 | 26-40 | CRUD Project (Notes App) |
| Phase 5 | 41-45 | Best Practices & Next Steps |
- PHP syntax, variables, data types
- Operators and control structures
- Loops and arrays
- Functions (user-defined & built-in)
- Forms,
$_GET,$_POST - Form validation & sanitization
- File handling (
fopen,fwrite,fread) - File uploads with validation
- Sessions & cookies
- Password hashing (
password_hash,password_verify)
- Database fundamentals
- SQL basics (CRUD operations)
- PHP-MySQL connection (mysqli/PDO)
- Prepared statements (SQL injection prevention)
- Pagination & search
A beginner-friendly notes application demonstrating:
- User authentication (Register, Login, Logout)
- Full CRUD functionality
- Pin & archive notes
- Search & filter by category
- Color-coded notes
- Responsive design
- Security best practices
- Backend: PHP
- Database: MySQL, SQLite
- Database Library: PDO
- Local Server: XAMPP / MAMP
- Frontend: HTML, CSS
- Install XAMPP or MAMP
- Clone this repository to your
htdocsfolder - Start Apache and MySQL services
- Navigate to any lesson folder and run:
php -S localhost:8000
corephp/
├── 01-hello-world/
├── 02-variables-datatypes/
├── 03-operators-conditionals/
├── 04-loops/
├── 05-arrays/
├── 06-functions/
├── 07-builtin-functions/
├── 08-forms/
├── 09-form-validation/
├── 10-form-project/
├── 11-file-handling/
├── 12-file-upload/
├── 13-sessions-cookies/
├── 14-password-hashing/
├── 15-login-system/ # Student Task
├── 16-database-basics/
├── 17-sql-crud/
├── 18-php-mysql/
├── 19-insert-data/
├── 20-fetch-data/
├── DATABASE_SETUP.md
├── MYSQL_SETUP.md
├── SQL_BEGINNERS_GUIDE.md
├── php-learning-plan.md
└── README.md
By the end of this 45-day journey:
- Build PHP web apps confidently
- Create secure CRUD applications
- Understand backend fundamentals
- Be prepared for Junior PHP / Backend Developer roles
Found a bug in an example, a typo, or have a better exercise idea? Contributions are welcome:
- Fork the repo and create a branch:
git checkout -b fix/day-09-validation - Make your change and commit it with a clear message
- Open a pull request describing what you changed and why
Released under the MIT License — free to use, adapt and teach from. Attribution is appreciated.
Made with ❤️ by Kiran Gautam · kirangtm.com.np
⭐ Star the repo if you found it useful!