Create Checksums Using The Luhn Algorithm In PHP
The Luhn algorithm was created by Hans Peter Luhn and is a way of creating a simple checksum for a number. This algorithm, also known as the mod 10 algorithm, is used in a wide variety of applications but is commonly associated with credit card numbers.
PHP: Find An Array Sequence In An Array
I was looking for a function that searched an array for another array, and after not finding one I decided to write it. What I was looking for was a function that took a smaller array and searched for that exact sequence of items in a larger array.
Conway's Game Of Life In PHP
I was saddened to hear of the passing of the Mathematician John Horton Conway today so I decided to put together a post on his 'game of life' simulator.
Bogo Sort In PHP
I came across this sorting algorithm the other day called 'bogo sort'. This is a sort of joke sorting algorithm that is highly ineffective at actually sorting arrays. The name comes from the word 'bogus'.
Here is how it works.
An Implementation Of Array Binary Search In PHP
I have been doing some reading and watching lectures of programming theory recently and I was reminded of this algorithm I learned about in university. Binary searching an array is a divide and conquer algorithm that takes an array and searches for a value in that array by splitting the array into halves. The algorithm works like this.
Sieve of Eratosthenes In PHP
The sieve of Eratosthenes is named after Eratosthenes of Cyrene who was a Greek mathematician who devised a mechanism to find a sequence of prime numbers using a simple algorithm.
Submitted by Eric on Tue, 05/05/2009 - 15:21Permalink
Submitted by philipnorton42 on Tue, 05/05/2009 - 15:25Permalink
Submitted by kido on Wed, 10/30/2013 - 13:15Permalink
Submitted by jell0wed on Tue, 07/01/2014 - 20:57Permalink
Submitted by philipnorton42 on Wed, 07/02/2014 - 18:45Permalink
Submitted by Craig on Mon, 12/22/2014 - 04:28Permalink
Submitted by philipnorton42 on Tue, 12/23/2014 - 14:13Permalink
Thanks for the arrays. Just FYI, they are never referred to as "states". It's "provinces" and "territories".
Submitted by Christina on Fri, 03/05/2021 - 18:03Permalink
Thanks for pointing that out Christina 🙂
Submitted by philipnorton42 on Sat, 03/06/2021 - 08:11Permalink
Add new comment