public static function normalize($string, $errmode = self::NORMALIZE_ERRMODE_SILENT)
    {
        $origString = $string;

        $string = strtoupper($string);
        if ($string !== $origString && $errmode) {
            throw new \RuntimeException("String '$origString' requires normalization");
        }

        $string = str_replace('-', '', strtr($string, 'IiLlOo', '111100'));
        if ($string !== $origString && $errmode) {
            throw new \RuntimeException("String '$origString' requires normalization");
        }

        return $string;
    }
public static function normalize($string, $errmode = self::NORMALIZE_ERRMODE_SILENT)
    {
        $origString = $string;

        $string = strtoupper($string);
        if ($string !== $origString && $errmode) {
            throw new \RuntimeException("String '$origString' requires normalization");
        }

        $string = str_replace('-', '', strtr($string, 'IiLlOo', '111100'));
        if ($string !== $origString && $errmode) {
            throw new \RuntimeException("String '$origString' requires normalization");
        }

        return $string;
    }
public static function normalize ( $ string , $ errmode = self :: NORMALIZE_ERRMODE_SILENT ) { $ origString = $ string ; $ string = strtoupper ( $ string ) ; if ( $ string !== $ origString && $ errmode ) { throw new \ RuntimeException ( "String '$origString' requires normalization" ) ; } $ string = str_replace ( '-' , '' , strtr ( $ string , 'IiLlOo' , '111100' ) ) ; if ( $ string !== $ origString && $ errmode ) { throw new \ RuntimeException ( "String '$origString' requires normalization" ) ; } return $ string ; }
Normalize a string

@param string $string  Encoded string
@param int    $errmode Error mode

@return string

@throws \RuntimeException
Normalize a string