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:
  • Write clean, maintainable PHP code using modern language features and best practices
  • Build secure web applications that protect against common vulnerabilities
  • Master database integration using PDO and object-relational mappings (ORMs)
  • Implement professional features like shopping carts and user authentication
  • Structure applications using object-oriented programming and model-view-controller (MVC) patterns
  • Leverage powerful tools like Composer and Twig to accelerate development

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.
Part 1: Fundamentals
Chapter 1: Introduction to PHP
Chapter 2: PHP Program Basics
Chapter 3: Numbers, Booleans, and NULL
Chapter 4: Working with Text Strings
Chapter 5: Making Choices
Chapter 6: Reusing Code with Functions
Part 2: Loops and Arrays
Chapter 7: Loops
Chapter 8: Simple Arrays
Chapter 9: Maps
Part 3: Websites and Form Processing
Chapter 10: Client–Server Communication
Chapter 11: PHP Websites and the Built-In PHP Server
Chapter 12: HTML Forms to Send Data
Chapter 13: Processing Form Data
Chapter 14: Validating Form Data
Chapter 15: Separating Logic and Output and Adding a Front Controller
Part 4: Sessions
Chapter 16: Working with Browser Sessions
Chapter 17: Shopping Carts
Chapter 18: Sessions for Login Authentication
Part 5: Object-Oriented PHP
Chapter 19: The Basics of Object-Oriented Programming
Chapter 20: Classes and Objects
Chapter 21: Inheritance
Chapter 22: Composer, Namespaces, and Autoloading
Chapter 23: Twig Templating
Chapter 24: Object-Oriented Web Architecture
Chapter 25: Exceptions
Chapter 26: Logging
Chapter 27: Static Members
Chapter 28: Interfaces and Traits
Chapter 29: Advanced Object-Oriented Concepts
Part 6: Databases
Chapter 30: Working with Databases
Chapter 31: Databases and Objects
Chapter 32: Improving Website Security
Chapter 33: Dates and Times
Dr. Matt Smith is a senior lecturer in computing at Technological University Dublin, specializing in web applications and immersive technologies. With over 30 years of teaching experience and degrees from the University of Huddersfield (BA), the University of Aberdeen (MSc), and the Open University (PhD), he has been at the forefront of PHP-based web development education since the mid-2000s.

About

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:
  • Write clean, maintainable PHP code using modern language features and best practices
  • Build secure web applications that protect against common vulnerabilities
  • Master database integration using PDO and object-relational mappings (ORMs)
  • Implement professional features like shopping carts and user authentication
  • Structure applications using object-oriented programming and model-view-controller (MVC) patterns
  • Leverage powerful tools like Composer and Twig to accelerate development

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 1: Fundamentals
Chapter 1: Introduction to PHP
Chapter 2: PHP Program Basics
Chapter 3: Numbers, Booleans, and NULL
Chapter 4: Working with Text Strings
Chapter 5: Making Choices
Chapter 6: Reusing Code with Functions
Part 2: Loops and Arrays
Chapter 7: Loops
Chapter 8: Simple Arrays
Chapter 9: Maps
Part 3: Websites and Form Processing
Chapter 10: Client–Server Communication
Chapter 11: PHP Websites and the Built-In PHP Server
Chapter 12: HTML Forms to Send Data
Chapter 13: Processing Form Data
Chapter 14: Validating Form Data
Chapter 15: Separating Logic and Output and Adding a Front Controller
Part 4: Sessions
Chapter 16: Working with Browser Sessions
Chapter 17: Shopping Carts
Chapter 18: Sessions for Login Authentication
Part 5: Object-Oriented PHP
Chapter 19: The Basics of Object-Oriented Programming
Chapter 20: Classes and Objects
Chapter 21: Inheritance
Chapter 22: Composer, Namespaces, and Autoloading
Chapter 23: Twig Templating
Chapter 24: Object-Oriented Web Architecture
Chapter 25: Exceptions
Chapter 26: Logging
Chapter 27: Static Members
Chapter 28: Interfaces and Traits
Chapter 29: Advanced Object-Oriented Concepts
Part 6: Databases
Chapter 30: Working with Databases
Chapter 31: Databases and Objects
Chapter 32: Improving Website Security
Chapter 33: Dates and Times

Author

Dr. Matt Smith is a senior lecturer in computing at Technological University Dublin, specializing in web applications and immersive technologies. With over 30 years of teaching experience and degrees from the University of Huddersfield (BA), the University of Aberdeen (MSc), and the Open University (PhD), he has been at the forefront of PHP-based web development education since the mid-2000s.