public static function secureString($string, $privateInfo, $padWith = 'x')
    {
        $result = $string;

        if (empty($privateInfo)) {
            return $result;
        }

        if (!is_array($privateInfo)) {
            $privateInfo = array($privateInfo);
        }

        foreach ($privateInfo as $privateString) {
            $replacement = str_repeat($padWith, strlen($privateString));
            $result = str_replace($privateString, $replacement, $result);
        }

        return $result;
    }
public static function secureString($string, $privateInfo, $padWith = 'x')
    {
        $result = $string;

        if (empty($privateInfo)) {
            return $result;
        }

        if (!is_array($privateInfo)) {
            $privateInfo = array($privateInfo);
        }

        foreach ($privateInfo as $privateString) {
            $replacement = str_repeat($padWith, strlen($privateString));
            $result = str_replace($privateString, $replacement, $result);
        }

        return $result;
    }
public static function secureString ( $ string , $ privateInfo , $ padWith = 'x' ) { $ result = $ string ; if ( empty ( $ privateInfo ) ) { return $ result ; } if ( ! is_array ( $ privateInfo ) ) { $ privateInfo = array ( $ privateInfo ) ; } foreach ( $ privateInfo as $ privateString ) { $ replacement = str_repeat ( $ padWith , strlen ( $ privateString ) ) ; $ result = str_replace ( $ privateString , $ replacement , $ result ) ; } return $ result ; }
Secure string for screen output

@param  string       $string      String to secure
@param  string|array $privateInfo One or more strings to secure
@param  string       $padWith     String to use for replacement
@return string
Secure string for screen output