public static function ucwords($str, $use_enc = null)
{
$enc = self::$hab_enc;
if ($use_enc !== null) {
$enc = $use_enc;
}
if (self::$use_library == self::USE_MBSTRING) {
$delimiters = array(chr(32), chr(12), chr(10), chr(13), chr(9), chr(11));
// loop through the delimiters and explode the string by each one
foreach ($delimiters as $d) {
$pieces = explode($d, $str);
for ($i = 0; $i < count($pieces); $i++) {
// capitalize each word
$pieces[$i] = self::ucfirst($pieces[$i], $enc);
}
// put the string back together
$str = implode($d, $pieces);
}
} else {
$str = ucwords($str);
}
return $str;
}