Recursive Code to Parse Recursive Form Data

Reading Time: 3 minutes Recursive code can be very confusing and frustrating at first, but is a necessity if you are trying to accomplish certain tasks in an expandable, decoupled way.  I recently needed to make a function that could build a multi-dimensional array from a form.  The problem is that the depth of the array is completely fluid as the form is made by nested “rules” which play off each other, allowing the user to build a very complex rule set.  Without going into the details of of the proprietary code for my company, let’s take a look at the technique I chose and …

Resources I Love

Reading Time: 3 minutes There are a lot of great PHP resources out there.  I wanted to take a few minutes to simply put my favorites out there and allow this to be a place you can find good resources – both mine and other users! Add your favorites to the comments section below as a service to your fellow coders! Websites/Blogs: PHP Weekly.  This is a great email service that sends out an email every Thursday that has announcements and helpful articles.  It’s not its own blog per se, but more of a place to find great blog articles. I recommend this as …

Getting Advanced with Variables

Reading Time: 5 minutes Variables are pretty straightforward in PHP. Anything that starts with a $ is a variable.  However, there are some things about them that can be somewhat confusing.  Let’s do an overview of Variables in PHP. Type Juggling In PHP, variables will automatically convert to whatever type is needed.  Most of these transformations are very natural and it allows programmers to spend the majority of time working on the application logic.  However, every now and then some of the automatic conversions can get you in trouble if you’re not prepared. For example, if you try to multiply an integer and a …

WebSockets and Ratchet

Reading Time: 9 minutes WebSockets have been around for quite some time, but are recently gaining a lot of popularity due to their ability to initiate messages from the server to the user, allowing the website to update on the fly! In this article I’ll be taking a look at what WebSockets are and how you can implement them using asynchronous PHP and Ratchet.