Monthly Archives: January 2009

PHP Explode()

Explode() is a widely-used PHP string function that is also one that tends to mystify beginners looking at others’ code. It’s a nifty little function that you may find plenty of uses for once you know how it works.

Explode() takes two arguments, a delimiter and the string you wish to operate on, then returns an array. The function splits a string into multiple pieces at the delimiter, and puts each piece into a numerical array.

Have a list of comma-separated words? (A scenario increasingly common now that “tagging” has become such a popular device.) You can pass a comma-delimited string to explode() with a delimiter of “,” and voila, you have an array containing each of the items.

$string = "lorem, ipsum, dolor";
$delimiter = ", ";
$array = explode($delimiter, $string);

Now you have a single-dimension numerical array with each list item in it. $array[0] would contain “lorem” and $array[1] would be “ipsum” and so on.

Continue reading →

BlogBuzz January 10, 2009

What You Need to Know About Blocking Ads

Thaya Kareeson from Omninoggin recently pointed me in the direction of a site called AdBlock.org, a site that seems to have a similar view of of ad blockers as my own. Adblocking software is a response to abusive activity by advertisers. It’s the continuation…

WordPress Theme of the Month: Desk Space

This month’s featured WordPress theme is “Desk Space” by Dirty Blue Media.

Design Your Way to More Blog Comments

StylizedWeb has an interesting post up on increasing the number of comments on your posts. It covers a lot of ground, and has some tips worth trying. Engaging Readers, Design Your Way to More Blog Comments First the post explains why people comment, and…

PHP Tip: Replace URLs With Links

I was trawling through the PHP function reference the other day, looking for some information on regular expressions, when I happened across this gem: $text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\" rel=\"nofollow\">\\0</a>", $text); It may look like gibberish at first, but if you look at it…

Reminder: Update Your Copyright Notice

It’s 2009 now, which means it’s time to update an important part of your website that is easy to overlook: The copyright notice in your footer. If you haven’t already updated the line of text, which should read something along the lines of “©2009…

WordPress 2.7 Favorites Menu Manager Plugin

I would like to formally announce my latest WordPress plugin today. Behold Favorites Menu Manager. When WordPress 2.7 launched, a small menu was added to the upper-right corner of the Admin. This menu was referred to as a Favorite Actions menu. The menu, by…

BlogBuzz January 3, 2009

WP125 Patch 1.2.1 Released

If you have already updated to WP125 version 1.2.0, which was released just a few days ago, you would be strongly advised to upgrade to the the new 1.2.1 release, which fixes a critical bug. If you are running 1.2.0, ads will not be…

Page 3 of 41234