Tag: PHP
-
How to calculate United States holiday observances
Usually around a holiday I will do a post that’s somehow related to the holiday. Seemed kind of silly to do a post on how to calculate Independence Day in the United States since it’s pretty straight forward. It always lands on the 4th day of the month of July….
-
How to POST to a webhook in 5 different programming languages
With the release of inbound webhooks for CrowdSync workflows last week, it seemed fitting to do a write up on how to POST to a webhook. So what is a webhook, anyway? The Wikipedia definition is that webhooks are “used-defined HTTP callbacks”. Kind of a stuffy definition if you ask…
-
URL routing in PHP
The other day I was checking out what folks are querying to get to my site. Of course a ton of people get here looking for VPS comparison, but what surprised me was the volume of queries for “PHP routing”. Back in 2015 I had posted a basic page rounding…
-
PHPUnit with multiple versions of PHP and HHVM on Travis CI
Recently I was updating my PHP Lorem Ipsum library in an attempt to get it testing on HHVM on Travis CI alongside the other versions of PHP I was testing against. Incidentally, the last time I had worked on the project, I had to work out some kinks with older…
-
Upgrade to PHP 7.x on Ubuntu 14.04 LTS
Upgrading to PHP 7.x (7.0 or 7.1 as of the time of this writing) is just as easy as it is to upgrade to PHP 5.6! Before we install PHP 7.x, I would recommend getting your system up to date: sudo apt-get update Next you will need to add the…
-
I beat PHP and so can you!
By request from Bill Martin, an abridged history of my relationship with the bastard child of programming languages, PHP. Ahh PHP. I love it. I hate it. For well over a decade, I slung PHP day and night. I got into PHP at the tail end of version 3. Prior…
-
Reading a specific line from a file with PHP
As I’ve been building a system that is driven primarily by CSV files (because it’s easier to use Google Sheets than it is to build out an admin section) I’ve had to get creative. Recently I found myself working with a CSV file that’s around of 3000 lines of data…
-
Convert Mongo BSONDocument to an array in PHP
Ran into a scenario this weekend where I needed to take a sub-document from Mongo but I needed it in an array in PHP. Reading the data from Mongo with PHP was simple and won’t be discussed. What I’d like to talk about is taking the BSONDocument that Mongo returns…
-
Programming the same thing in multiple programming languages
Recently I set out on an interesting journey. I wanted to build programming libraries for my API, HolidayAPI. Some of the languages I know like the back of my hand. Others, have never even touched them before. Before you start sending me hate comment, I am fully aware of Swagger….
-
Get the day of the week from a date in PHP
Typical of PHP, it’s very easy to get the day of the week from a date, but they also provide the data in multiple format. Three in fact. The first, and arguably the most straight forward is to get the textual name of the day of the week. <?php echo…