← All posts

PHP Done The Correct Way is out on Kindle and in paperback

PHP Done The Correct Way (2nd edition) is out on Kindle and in paperback: modern PHP 8.5 for real sites, with free companion code on this site.

Book cover for PHP Done The Correct Way, 2nd edition, by Ian Croasdell, with a PHP 8.5 badge

My book, PHP Done The Correct Way (2nd edition), is out on Amazon, on Kindle and in paperback.

I wrote it for people who build and look after real PHP sites, not for people who want another tour of Hello World. It teaches PHP 8.5 the way working systems need it: strict types, tested code, prepared statements, escaped output, safe passwords and sessions, and deployments you can repeat and roll back.

Who it is for

  • New PHP developers who want to learn the language properly the first time.
  • Developers coming back to PHP after years away, who need to know what has changed since PHP 5 and 7.
  • Freelancers and small agencies building sites for UK businesses, who need the production, legal and business chapters as much as the code.

It assumes you can use a text editor and a terminal, and have built a web page before. It does not assume you know PHP, and it does not teach the old ways first and correct them later.

What you build

Across 24 chapters you build one small application for a fictional handyman business, Northstar Repairs. It has enquiry forms, a database, logins, invoices with VAT held in integer pence, background jobs and a production server.

Every example program was run on PHP 8.5 when the book was built, and the output printed in the book is the output those programs produced. The build fails if any example fails or its output changes.

A few chapter highlights:

  • Types, functions, arrays, dates and money without the bad habits that still turn up in older tutorials.
  • Forms, sessions, PDO and the security basics, done properly.
  • Testing, Composer, APIs, webhooks and background jobs.
  • Performance, deployment, backups and modernising old code.
  • The legal and business side of running PHP sites for UK businesses.
  • One production checklist you can use on your own projects.

Where to buy it

The paperback should reach Amazon US and the other Amazon stores over the next few days.

Free companion code

If you buy the book, the companion code lives on this site, not inside the book.

Download the free companion code

The page has the example code and a short note on how to run it. More about the book itself is on the book page.

If you write PHP for a living, or you are about to, I hope it saves you a few of the mistakes I made the hard way.

Let's talk More posts