Functions
abstract class Functions (View source)
A class with UTF-8 string functions, some inspired by what might be in some future PHP version.
..
Methods
Converts the first character of each word to uppercase and all remaining characters to lowercase.
Unicode variant of substr()
Unicode variant of strtoupper()
Unicode variant of strtolower()
Uniocde variant of strlen() - assumes that the string is a Unicode string, not binary
Unicode variant of ucfirst() - assumes that the string is a Unicode string, not binary
Unicode variant of lcfirst() - assumes that the string is a Unicode string, not binary
Unicode variant of strpos() - assumes that the string is a Unicode string, not binary
Unicode variant of pathinfo() pathinfo() function is not unicode-friendly if setlocale is not set. It's sufficient to set it to any UTF-8 locale to correctly handle unicode strings.
Parse a URL and return its components, UTF-8 safe
Details
static string
strtotitle(string $string)
Converts the first character of each word to uppercase and all remaining characters to lowercase.
static string
substr(string $string, int $start, int $length = null)
Unicode variant of substr()
static string
strtoupper(string $string)
Unicode variant of strtoupper()
static string
strtolower(string $string)
Unicode variant of strtolower()
static int
strlen(string $string)
Uniocde variant of strlen() - assumes that the string is a Unicode string, not binary
static string
ucfirst(string $string)
Unicode variant of ucfirst() - assumes that the string is a Unicode string, not binary
static string
lcfirst(string $string)
Unicode variant of lcfirst() - assumes that the string is a Unicode string, not binary
static int
strpos(string $haystack, string $needle, int $offset = 0)
Unicode variant of strpos() - assumes that the string is a Unicode string, not binary
static string|array
pathinfo(string $path, int $options = null)
Unicode variant of pathinfo() pathinfo() function is not unicode-friendly if setlocale is not set. It's sufficient to set it to any UTF-8 locale to correctly handle unicode strings.
This wrapper function temporarily sets locale to 'en_US.UTF-8' and then restores original locale. It's not necessary to use this function in cases, where only file extension is determined, as it's hard to imagine a unicode file extension.
static mixed
parse_url(string $url, int $component = -1)
Parse a URL and return its components, UTF-8 safe