php

Can we Google bomb good PHP tutorials to the top?

There is an ongoing debate about how terrible PHP is. I'm not going to rehash any of that here, but I began to consider what the community could do about this and an idea came to mind - what if we Google bombed good tutorials?

Tags: 

Quick and dirty PHP memoization

The concept of memoization is simple - cache the results of an expensive function for future calls. I solved a problem recently through memoization, and since I haven't written an article in over a month (due to a death in the family and then moving into a new house), I figured this is a good subject to quickly write something on.

Tags: 

Straying from LAMP

I recently read an article that very thoroughly tears into the problems that are inherent in PHP. While this one article won't get me to ditch PHP immediately, it did really hit home with many of the points it brings up. There were many times that I thought "You know, I do hate that about PHP" and it made me wonder how many of these issues are present in other languages, or if PHP really is a relatively isolated instance of a terrible language, as the author says.

Tags: 

Using trigger_error to deprecate old PHP systems

If you spend enough time writing code, you'll eventually come across a better way to do something and have the desire to replace all of your previous code with this superior method. Or, you'll find a block of code that you can quickly see is useless or redundant and you want to get rid of it. In both of these scenarios, simply removing the old code and putting in the new code seems like the obvious answer, but it's not always so easy.

The magic column pattern

Ever since I changed jobs at the start of the year, I've been far more cavalier with trying new techniques and seeing how they pan out. I don't know where this sudden devil-may-care attitude came from, but I suspect it's lifting the burden of old systems from my shoulders and a mirror of the approach I have taken with Fusion. The old systems were so ingrained in me that they almost became a force of nature unto themselves that couldn't be changed by a mere mortal code jockey like myself.

Parsing a consistent request on different environments

At work, I've recently been spending time on a router class for the custom framework that powers our internal administration system. This router will just about everything related to URL requests, including:

Tags: 

Team Liquid Calendar

I just finished the first release of a new project that aims to put the Team Liquid calendar into Google Calendar.

Dealing with PHP and character encoding

How many times have you been presented with a character encoding glitch on a PHP site that you thought was working properly? You finished the site months ago with no issues, but now you are being told some weird character is showing up on that page? Chances are, that character is either Ã, Â or Ä, possibly followed by some other random character. If I’m right, keep reading. If not, I offer my deepest condolences, for you are knee deep in a character encoding issue that I cannot help you with.

How to unchunk data received through PHP sockets

When using the PHP socket functions to pull data from another website, you'll often find yourself dealing with chunked data. Chunked data often looks like this:

Pages