You can use PHP’s built in directory iterator (in php 5 or 7) to loop over a directory and perform operations on the files easily.
How to Test a Date for Validity
Needed a function to test if a date was valid in PHP. This function does that but it also requires an expected date format. Example
How to Insert on Duplicate Key Update (an upsert)
This example of a upsert, an on duplicate key insert statement in MySQL. What it does is if the table zipcode_population has a unique index
Function to Remove Dollar Signs and Commas From a Number
I needed a function to turn a string value dollar with commas into a decimal I could insert into MySQL. This function below will take
Using pathinfo Function to Detect File Extention
Sometimes that’s not necessary to check a file’s mime type and you only need to check the file extension. To do that we can use
Function to Parse URLs From a PDF Document
You don’t have to actually programmatically read a PDF to parse out the links in them. This simple routine below will parse out all the
Learn PDO In 30 Seconds
phpdelusions is my main go to guide for everything php/pdo. But to just get started with PDO you really only need to know a few
A Simple Slope One User Item Recommender In PHP/MySQL
Big fan of user/item recommenders, which is also known as collaborative filtering. Slope one is a very basic but reasonably accurate recommender algorithm which makes
Parse Emails From a String
Handy one for all sorts of reasons, just don’t use it for evil : \. I also did an online working version of this function.
Big List of Code Snippet & Playground Sites
Code playground sites are awesome for front end developers. They let users collaborate and teach unlike ever before. If you’ve ever been on StackOverflow for