Not exactly what you want, this is an example of creating proper case in PHP
function convert2proper($strVal){
$iPos = 0;
$strValTmp = "";
do {
$iSpace = strpos($strVal," ", $iPos);
$strValTmp .= strtoupper(substr($strVal, $iPos, 1));
$strValTmp .= strtolower(substr($strVal, $iPos + 1, $iSpace - $iPos));
$iPos = $iSpace + 1;
} while(strpos($strVal," ", $iPos) != FALSE);
$strValTmp .= strtoupper(substr($strVal, $iPos, 1));
$strValTmp .= strtolower(substr($strVal, $iPos + 1));
return $strValTmp;
}
function cutString($strVal,$limit){
if(strlen($strVal)>$limit){
return substr($strVal,0,$limit) . "...";
}else{
return $strVal;
}
}
These are 2 functions that are very useful in search engines and filling select boxes where you don't want the select box to be wider than a certain character length. the first one converts strings to proper case, with the beginning of every word in caps. the second will cut text at a certain length and will put "..." at the end.
Use is pretty self explanitory.
convert2proper("HI HOW ARE YOU?"

returns "Hi How Are You?"
It is possible to get proper case in PostGresql as well