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.

PHP:
  1. $array = array_map(‘trim’, $array);

array_map will step through the array members and apply the trim() function to each giving you a nice, clean array without leading spaces.

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 does the design play in that success? 

Read the rest of this entry »

Sometimes spam is just funny

Spam is one of those problems that you can’t do much about, so you might as well try and find a little humor.

Perfect example. I just got an email to moderate a comment here that was a spam ad for software to spam forums, blogs, and guestbooks. Were I looking for such software, which I’m most certainly not, the fact that WordPress caught the comment in its moderation queue doesn’t speak too highly of how well this software works.

Try this - about:robots in FireFox

Type about:robots into the address bar in FireFox and press enter. You’ll find an easter egg.

Quick CSS to hide disabled scroll bars in Internet Explorer

The scroll bars in Internet Explorer never go away. If they’re not needed, they just disable. To me this is an incorrect behavior, and it was really causing problems on a site I’m working on where I’m handling the scroll bars inside of a wrapper div anyway so I didn’t want two scroll bars.

Turns out with one little bit of CSS they go away.

CSS:
  1. html { overflow: auto; }

Poof, the disabled scroll bars are gone but will come back if needed.