If you know me then you know I fucking adore Redis. Over the last few years it’s slowly worked it’s way into the majority of the things I have built. Unfortunately, recently I ran into a problem that Redis could…
I’ve discussed the use of preg_replace_callback in the past in regard to passing variables to anonymous functions but never touched on how to use preg_replace_callback or the fact that the /e modifier has been deprecated in PHP 5.5+. Even though…
After giving it nearly a full calendar year, I have decided to migrate my PHP blog (PHP Avenue) off of WordPress via WP Engine and on to GitHub Pages. The decision ultimately boiled down to WordPress having way more available…
PHP Data Objects (PDO) is arguably the best database abstraction layer available in PHP. It provides a consistent interface across multiple datasources (MySQL, PostgreSQL, et cetera) and helps boost your site’s security by way of prepared statements. It even supports…
Not only is it the dirtiest thing you wear, it’s quite possibly the dirtiest thing you own and it’s fucking disgusting. What is it, you ask? It’s your belt, your dirty disgusting belt. Why is your belt so disgusting? Because…
Zero filling (or zero padding) is when you pad a value on the left side to a specific length. This is something you will commonly see in database schemas for integer columns. But what if we’re not working with data…
Hi, my name is Josh and I am a Vim addict. I have been for quite a while now, nearly 15 years by my estimates. I love everything about it but in all honesty, I have only really started to…
One of PHP’s most powerful features are arrays and the multitude of functions available to interact with and manipulate them. Arrays can be indexed by integers as well as string, known as an associative array. Instead of looping through the…
Ran into a bit of an issue today when deploying some changes to my blog. The home page, which was working just fine locally, was being treated as if it were a blog post page. What keyed me off to…
The other day I ran into a situation (first time, it seems) where I needed to access a variable inside of an anonymous function inside of preg_replace_callback(). My first thought, even though it went against my better judgement was to…