protected function encode($string)
    {
        if (is_array($string)) {
            foreach ($string as $i => $value) {
                $string[$i] = $this->encode($value);
            }

            return $string;
        }

        if (is_scalar($string)) {
            return str_replace('%7E', '~', rawurlencode($string));
        }

        return null;
    }
protected function encode($string)
    {
        if (is_array($string)) {
            foreach ($string as $i => $value) {
                $string[$i] = $this->encode($value);
            }

            return $string;
        }

        if (is_scalar($string)) {
            return str_replace('%7E', '~', rawurlencode($string));
        }

        return null;
    }
protected function encode ( $ string ) { if ( is_array ( $ string ) ) { foreach ( $ string as $ i => $ value ) { $ string [ $ i ] = $ this -> encode ( $ value ) ; } return $ string ; } if ( is_scalar ( $ string ) ) { return str_replace ( '%7E' , '~' , rawurlencode ( $ string ) ) ; } return null ; }
Generates an oauth standard encoding

@param *string $string The string to encode

@return string
Generates an oauth standard encoding