PHP Crash Course Cover

PHP Crash Course

by Matt Smith
December 2024, 800 pp
ISBN-13: 
9781718502529
Use coupon code PREORDER to get 25% off!

Download Chapter 7: Simple Arrays

Look Inside!
PHP Crash Course pages 8-9PHP Crash Course pages 112-113PHP Crash Course pages 442-443

This book will take you from beginner-level to professional PHP programming, through hundreds of in-depth examples and hands-on exercises. You’ll explore best practices for developing fast, secure, and easy-to-maintain websites, while establishing a broad foundation of programming knowledge and experience. You’ll learn how to:

  • Create consistent, modern-looking web pages with easily customizable templates by combining dynamic PHP scripts, static HTML code, and Bootstrap styling
  • Write server-side scripts for responding to HTTP requests, processing forms, and validating data
  • Use browser sessions to implement shopping carts and user logins, and to store other user data
  • Write scripts that can communicate with MySQL and other PDO databases, enabling database-driven, data-rich web applications
  • Implement modern, best-practice website security, including user data sanitization, session-based logins using hashed passwords, and database prepared statements
  • Save time with up-to-date, professional, open-source tools, including Composer dependency management and the Twig templating library

As you follow along, you’ll learn real-life patterns and modern programming techniques for creating, extending, and modifying web applications, all using the powerful PHP language.

Author Bio 

Dr. Matt Smith is senior lecturer in computing at Technological University (TU) Dublin, Ireland, specializing in interactive multimedia interaction including web applications, extended reality (XR), and e-learning systems. He holds a bachelor’s degree in business computing (University of Huddersfield, UK), a master's in artificial intelligence (University of Aberdeen, Scotland), and a PhD in computational musicology (Open University, UK). He has been teaching for over 30 years. In the mid-2000s, at the request of his students, he switched the focus of his web development courses from Java to PHP, and he’s been a fan of PHP and the Symfony open source web framework ever since.

Table of contents 

Acknowledgments 
Introduction
PART I: LANGUAGE FUNDAMENTALS
Chapter 1: PHP Program Basics
Chapter 2: Data Types
Chapter 3: Strings and String Functions
Chapter 4: Making Choices with Conditionals
Chapter 5: Creating Reusable Code with Functions
PART II: WORKING WITH DATA
Chapter 6: Repeating Actions with Loops
Chapter 7: Simple Arrays
Chapter 8: Sophisticated Arrays
Chapter 9: Working with 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 

The chapters in red are included in this Early Access PDF.