Trimming array elements in PHP

Several times I’ve had a user setting that was separated by commas that I needed to split out into an array. People, correctly, put a space after commas. But for the array the space shouldn’t be there. Here’s a quick tip to strip out those leading spaces.
PLAIN TEXT
PHP:

$array = array_map(‘trim’, $array);

array_map [...]

How important is design to the success of a forum?

How important do you think design is to the success of a forum?  It’s an extremely popular topic on web design forums.  Content or design?  Which has the bigger effect on the success of a forum?
I don’t think anyone would argue that a forum can succeed without good content, but how big of a part [...]

JavaScript Error ‘expected identifier, string or number’ in IE

Sometimes you get those errors that just pick at you and you can’t seem to find a solution. It happened to me this morning when testing a JavaScript library I’m writing in IE7. FireFox worked without a hitch, but IE threw an ‘expected identifier, string or number’ error pointing to the last line [...]

How to insert tabs in a textarea

I’ve always found it annoying that tabs don’t, well, tab in textareas on HTML pages. To be fair, they do what they’re supposed to and move on to the next field. But for a web app I’m working on I needed a way for the tab key to insert a tab.

addthis_url [...]

Why is middle the default vertical align for a table cell?

A little bit of a rant here. Why do HTML table cells default to vertically centering the text? I have never done a design that it looked right for the cells to be vertically aligned to the middle. It seems that top aligned would be the most commonly used and for those [...]