Category: Software Development
-
Developer titles are bullshit, Part 2 – Universal titles
Last week in part one, I discussed the lifecycle of a developer that just started a new job. The gist was that when someone starts a new role at a company, they generally have to learn the lay of the land. Regardless of their technical prowess there is always a…
-
How to round numbers with PHP
Rounding numbers can be done a number of ways. You can round a float up or down to the nearest integer or you could round to a specific precision. Even then you can choose whether or not to round halves up or down and even round towards even and odd…
-
Developer titles are bullshit, Part 1 – The lifecycle of a developer
This is a pretty universal truth, most developer titles are complete and utter nonsense. Shit like “Junior Developer” and “Senior Engineer Level 2”, sounds like we’re playing Dungeons and Dragons. Sad part of this is, most people will say they don’t care about titles but then they are quick to…
-
Converting decimal to other number systems with PHP
It felt a bit like cheating to split this post up so I figured I would just cover all of the decimal to… functions in one post. Decimal, also known as base ten, is the numerical base we are most accustomed to. From time to time we need to convert…
-
To infinity and beyond! Working with infinity in PHP
We can file this one under the “PHP functions I never knew existed and probably will never use” category. Seems that as of PHP 4.2.0 and beyond there was the inclusion of an is_finite() and an is_infinite() function. The names are pretty self explanatory and I’m sure there are some…
-
Finding the smallest or largest value with PHP
Figured I would keep up the trend of talking about finding the smallest and largest values in arrays by talking about finding the smallest or largest value in a set of values. Incidentally, doing so will utilize the same min() and max() functions we used previously. Not one of my…
-
Find the largest value in an array with PHP
Last week we discussed how to find the smallest value in an array so it seemed fitting to discuss how to find the largest value in an array. As we previously discussed back in the day you would have to loop through an array and compare values until you found…
-
Find the lowest value in an array with PHP
Finding the lowest value of an array is a pretty common task in PHP, especially when you are dealing with things like scores or money. In the old days before PHP 4, finding the lowest value of an array meant looping through the array and comparing values until you had…
-
How to convert an array to a string with PHP
Converting an array to a string is a pretty frequent task when programming. Whether you want to join some sentences into a paragraph or just smash the values into some sort of hash, you can do so very simply with PHP’s implode function. Implode takes 1 to 2 arguments. In…
-
Days until Christmas in PHP
The holidays are upon us so it’s time for my obligatory holidays themed post! Keep in mind that the title may say Christmas but you could apply this same logic to any holiday or date of your choosing. $christmas = date(‘Y-12-25’); $today = date(‘Y-m-d’); echo (strtotime($christmas) – strtotime($today)) / 86400;…