/**
 * Uppercases the first character of each word in a string.
 * @param string $string				The input string.
 * @param string $encoding (optional)	The used internally by this function character encoding.
 * If it is omitted, the platform character set will be used by default.
 * @return string						Returns the modified string.
 * This function is aimed at replacing the function ucwords() for human-language strings.
 * @link http://php.net/manual/en/function.ucwords
 */
function api_ucwords($string, $encoding = null)
{
    return Utf8::ucwords($string);
}
 public function test_linefeed()
 {
     $str = "iñt ërn âti\n ônà liz æti øn";
     $ucwords = "Iñt Ërn Âti\n Ônà Liz Æti Øn";
     $this->assertEquals($ucwords, u::ucwords($str));
 }
예제 #3
0
파일: String.php 프로젝트: robclancy/string
 public function upperWords()
 {
     $this->string = u::ucwords($this->string);
     return $this;
 }