Function Reference: geodir_ucwords

Summary

Converts string to title case.

Description

This function converts string to title case. Ex: hello world -> Hello World.
When mbstring php extension available this function supports all unicode characters.

Package

Geodirectory

Parameters

$string
(string) (required) String to convert.

Default: None
$charset
(string) (required) Character set to use for conversion.

Default: None

Return Values

(string)
  • Returns converted string.

Change Log

Since: 1.5.4

Source File

geodir_ucwords() is located in geodirectory-functions/helper_functions.php [Line: 241]

Source Code

function geodir_ucwords($string, $charset='UTF-8') {
    if (function_exists('mb_convert_case')) {
        return mb_convert_case($string, MB_CASE_TITLE, $charset);
    } else {
        return ucwords($string);
    }
}