How to Determine if it is Friday the 13th with PHP

By Josh Sherman
1 min read
development
php

It seemed fitting that my post on Friday the 13th would be about Friday the 13th. There are 52 Fridays in 2013, but only 2 of them are the 13th day of the month (September and December). To determine if a Friday is a Friday the 13th, we will need […]

Building a Number Guessing Game in PHP

By Josh Sherman
1 min read
development
php
video games
video game development

Believe it or not, but the last 13 or so posts have all been leading up to this one. Generating random numbers, capturing user input, using colors on the command-line, pluralizing words, and then some are all being utilized in this simple number guessing game. The script itself generates a […]

The Wrong Way to Save

By Josh Sherman
2 min read
personal finance

If you’ve ever been to a Disney theme park you’ve probably seen them. People with notebooks busting at the seams with pins, wheeling and dealing with other vacationers as well as Disney cast members. These notebooks are often filled with hundreds of pins valued at thousands of dollars, and some […]

How to Terminate a PHP Script

By Josh Sherman
1 min read
development
php

Terminating the execution of a script is usually one of those last ditch ways to handle an error, but it is something we do from time to time, especially if we’re debugging. To terminate the execution of a script, you can call either exit or die, die being an alias […]

How to Pluralize Words with PHP

By Josh Sherman
1 min read
development
php

There’s a good chance you’ve seen it before (and possibly authored it), it looks something like this “You have 1 new messages” or “There are 10 user(s) logged in”. What you end up with is something that’s either incorrect or something like looks a bit amateurish. To fix this, we […]