How to merge two sorted PHP arrays without array_merge() or sort()

By Josh Sherman
2 min read
development
php

I’ve had this question come up a few times in the past on interviews, how would you merge two sorted arrays and keep their sort order intact? The easy / PHP answer is to simply use array_merge() and then sort() the resulting array. Technically this works but the whole point […]

No, I will not fix your computer

By Josh Sherman
1 min read
rant

I abandoned all of my seemingly witty shirts a while ago, but I’m starting to think I need to pick this one up. At the very least, the mug perhaps. It’s not because I don’t want to help people, hell my tech career started in support. It’s because the problems […]

Visibility in PHP

By Josh Sherman
1 min read
development
php

Visibility of functions and properties is very important when you are attempting to lock down certain aspects of an object. In PHP there are three levels of visibility, public, private and protected. Let’s take a look at what each one means. Public Public is the easy one. It’s the default […]

The definition of “done”

By Josh Sherman
1 min read
developer etiquette

For me, “done” means that something I have been working on is to the point that I no longer have to work on it, indefinitely. Depending on the nature of the task it could also mean that it’s been shipped to production and again, no longer requires my efforts. I […]

Simple PHP i18n internationalization and localization class

By Josh Sherman
3 min read
development
php

As sites and system grow and scale, the need for internationalization and localization (i18n and L10n respectively) of content becomes a necessary task. There’s not much to it on the surface, you need to be able to serve up the same content in different languages. This includes abstracting out words […]