public static function strtotitle(string $string): string
    {
        $result = '';
        $splitIntoLowerCaseWords = preg_split("/([\n\r\t ])/", self::strtolower($string), -1, PREG_SPLIT_DELIM_CAPTURE);
        foreach ($splitIntoLowerCaseWords as $delimiterOrValue) {
            $result .= self::strtoupper(self::substr($delimiterOrValue, 0, 1)) . self::substr($delimiterOrValue, 1);
        }
        return $result;
    }
public static function strtotitle(string $string): string
    {
        $result = '';
        $splitIntoLowerCaseWords = preg_split("/([\n\r\t ])/", self::strtolower($string), -1, PREG_SPLIT_DELIM_CAPTURE);
        foreach ($splitIntoLowerCaseWords as $delimiterOrValue) {
            $result .= self::strtoupper(self::substr($delimiterOrValue, 0, 1)) . self::substr($delimiterOrValue, 1);
        }
        return $result;
    }
public static function strtotitle ( string $ string ) : string { $ result = '' ; $ splitIntoLowerCaseWords = preg_split ( "/([\n\r\t ])/" , self :: strtolower ( $ string ) , - 1 , PREG_SPLIT_DELIM_CAPTURE ) ; foreach ( $ splitIntoLowerCaseWords as $ delimiterOrValue ) { $ result .= self :: strtoupper ( self :: substr ( $ delimiterOrValue , 0 , 1 ) ) . self :: substr ( $ delimiterOrValue , 1 ) ; } return $ result ; }
Converts the first character of each word to uppercase and all remaining characters
to lowercase.

@param  string $string The string to convert
@return string The converted string
@api
Converts the first character of each word to uppercase and all remaining characters to lowercase .