The Complete, Modern, Hands-on Guide
Matt Smith

#PHP
#Crash_Course
#Data
#Object-Oriented
From First Script to Full Website—Fast!
Tired of cobbling together PHP solutions from scattered online tutorials? Frustrated by outdated PHP practices that leave your code vulnerable and hard to maintain? Whether you’re building your first dynamic website or modernizing legacy systems, PHP Crash Course gives you a complete, practical foundation for writing professional web applications.
In this comprehensive, example-driven guide, you’ll learn how to:
Starting with PHP fundamentals, you’ll progress through six carefully crafted sections covering essential patterns, security best practices, database integration, and advanced concepts like object-oriented programming. Each chapter builds on real-world examples, giving you the skills to solve common development challenges.
Whether you’re a complete beginner or an experienced developer looking to modernize your PHP skills, PHP Crash Course gives you everything you need to build professional, dynamic websites with confidence.
Includes setup instructions for Windows, macOS, and Linux, and configuration details for Replit, the free online development environment.
Table of Contents
PART I: LANGUAGE FUNDAMENTALS
Chapter 1: PHP Program Basics
Chapter 2: Data Types
Chapter 3: Strings and String Functions
Chapter 4: Conditionals
Chapter 5: Custom Functions
PART II: WORKING WITH DATA
Chapter 6: Loops
Chapter 7: Simple Arrays
Chapter 8: Sophisticated Arrays
Chapter 9: Files and Directories
PART III: PROGRAMMING WEB APPLICATIONS
Chapter 10: Client/Server Communication and Web Development Basics
Chapter 11: Creating and Processing Web Forms
Chapter 12: Validating Form Data
Chapter 13: Organizing a Web Application
PART IV: STORING USER DATA WITH BROWSER SESSIONS
Chapter 14: Working with Sessions
Chapter 15: Implementing a Shopping Cart
Chapter 16: Authentication and Authorization
PART V: OBJECT-ORIENTED PHP
Chapter 17: Introduction to Object-Oriented Programming
Chapter 18: Declaring Classes and Creating Objects
Chapter 19: Inheritance
Chapter 20: Managing Classes and Namespaces with Composer
Chapter 21: Efficient Template Design with Twig
Chapter 22: Structuring an Object-Oriented Web Application
Chapter 23: Error Handling with Exceptions
Chapter 24: Logging Events, Messages, and Transactions
Chapter 25: Static Methods, Properties, and Enumerations
Chapter 26: Abstract Methods, Interfaces, and Traits
PART VI: DATABASE-DRIVEN APPLICATION DEVELOPMENT
Chapter 27: Introduction to Databases
Chapter 28: Database Programming with the PDO Library
Chapter 29: Programming CRUD Operations
Chapter 30: ORM Libraries and Database Security
Chapter 31: Working with Dates and Times
Appendix A: Installing PHP
Appendix B: Database Setup
Appendix C: Replit Configuration
About the Author
Matt Smith is a senior lecturer in computing at Technology University (TU) Dublin, specializing in interactive multimedia and server-side web development. He has been teaching for over 30 years. Smith researches the use of applied computer game technology, especially to support teaching and learning, and is one of the authors of the Unity 2021 Cookbook.









