Transactions with PHP Data Objects (PDO)

By Josh Sherman
1 min read
development
php
database

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 transactions which we’ll be taking a look at here. Database […]

The dirtiest thing you wear

By Josh Sherman
1 min read
health

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 it’s something that you don’t launder. Not only do I […]

The importance of code editor proficiency

By Josh Sherman
4 min read
development
vim
productivity

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 get “good” with it in the last couple of years. […]

How to zero fill a number with PHP

By Josh Sherman
1 min read
development
php

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 that’s already zero filled by a database? All we have […]

How to get keys from an associative array in PHP

By Josh Sherman
1 min read
development
php

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 array with foreach and assigning the key to another array, […]