public static function nameCase($string = '', array $options = [])
    {
        if ($string == '') return $string;

        self::$options = array_merge(self::$options, $options);

        // Do not do anything if string is mixed and lazy option is true.
        if (self::$options['lazy'] && self::skipMixed($string)) return $string;

        // Capitalize
        $string = self::capitalize($string);
        $string = self::updateIrish($string);

        // Fixes for "son (daughter) of" etc
        foreach (self::$replacements as $pattern => $replacement) {
            $string = mb_ereg_replace($pattern, $replacement, $string);
        }

        $string = self::updateRoman($string);
        $string = self::fixConjunction($string);

        return $string;
    }
public static function nameCase($string = '', array $options = [])
    {
        if ($string == '') return $string;

        self::$options = array_merge(self::$options, $options);

        // Do not do anything if string is mixed and lazy option is true.
        if (self::$options['lazy'] && self::skipMixed($string)) return $string;

        // Capitalize
        $string = self::capitalize($string);
        $string = self::updateIrish($string);

        // Fixes for "son (daughter) of" etc
        foreach (self::$replacements as $pattern => $replacement) {
            $string = mb_ereg_replace($pattern, $replacement, $string);
        }

        $string = self::updateRoman($string);
        $string = self::fixConjunction($string);

        return $string;
    }
public static function nameCase ( $ string = '' , array $ options = [ ] ) { if ( $ string == '' ) return $ string ; self :: $ options = array_merge ( self :: $ options , $ options ) ; // Do not do anything if string is mixed and lazy option is true. if ( self :: $ options [ 'lazy' ] && self :: skipMixed ( $ string ) ) return $ string ; // Capitalize $ string = self :: capitalize ( $ string ) ; $ string = self :: updateIrish ( $ string ) ; // Fixes for "son (daughter) of" etc foreach ( self :: $ replacements as $ pattern => $ replacement ) { $ string = mb_ereg_replace ( $ pattern , $ replacement , $ string ) ; } $ string = self :: updateRoman ( $ string ) ; $ string = self :: fixConjunction ( $ string ) ; return $ string ; }
Main function for NameCase.

@param string $string
@param array  $options

@return string
Main function for NameCase .