There is a function ucwords() in PHP which capitalizes the first letter of each word.
I have written a sub-routine in Perl, which gives the same functionality.
$str = shift;
$str = lc($str);
$str =~ s/\b(\w)/\u$1/g;
$str = "programming forums";
$str = &ucwords($str);
# now $str = "Programming Forums"