Archive for August 2009

PHP Validation and Sanitization with filters

One of the most common problems in web development in validating and sanitizing user inputted data. Often, we’re tempted to reinvent the wheel when validating emails, ranges, booleans, etc.

Fortunately, php has a lot of these tasks already written. You can use the built in filters to validate and sanitize in a manner that’s already been tested and optimized by the core developers.



$email = '';

if (filter_var($email, FILTER_VALIDATE_EMAIL)) { echo 'This (email) email address is considered [...]

Read The Rest Of This Post


I saw the best minds of my generation destroyed by coding, starving hysterical naked, debugging their code through var dumps at dawn looking for an angry fix, angelheaded hipsters scripting for the ancient heavenly connection to the starry dynamic typing in the machinery of night, who poverty and tatters and hollow-eyed and high sat up smoking in the supernatural darkness of the web floating across the tops of integers contemplating lisp, who bared their brains to Heaven under the C and saw Euclidean angles staggering on algorithms illuminated, who passed through universities [...]

Read The Rest Of This Post

The Insufficiency of SCRUM

Interesting analysis of creeping issues in SCRUM. Having recently adopted SCRUM I haven’t seen the problems described here yet, but it’ll be good to keep an eye out.

Read The Rest Of This Post

Using gmdate()

Recently at work I came across an odd bug involving gmdate(). A client wanted us to post some information to them including two fields: source_date and source_time. The values are really just the time when we’re sending the information to them. However, they wanted it to be sent as GMT. So in preparing the request, I wrapped the source_time in gmdate(), tested and confirmed that it was giving the correct result. Then during an audit of their data they pointed out that [...]

Read The Rest Of This Post

Read Later Pile – Exploring Spl Interfaces

In an attempt to shed some light on and to draw attention to SPL, I plan to post several articles discussing various parts of this extension. I will start with SPL Interfaces so that you can grasp immediately the usefulness of the SPL.

Read The Rest Of This Post