public function parse_result($str) {
        if (empty($str)) {
            throw new moodle_exception('error');
        }
        $parts = explode('&', $str);
        $result = array();
        foreach ($parts as $part){
            list($k, $v) = explode('=', $part, 2);
            $result[urldecode($k)] = urldecode($v);
        }
        if (empty($result)) {
            throw new moodle_exception('error');
        }
        return $result;
    }
public function parse_result($str) {
        if (empty($str)) {
            throw new moodle_exception('error');
        }
        $parts = explode('&', $str);
        $result = array();
        foreach ($parts as $part){
            list($k, $v) = explode('=', $part, 2);
            $result[urldecode($k)] = urldecode($v);
        }
        if (empty($result)) {
            throw new moodle_exception('error');
        }
        return $result;
    }
public function parse_result ( $ str ) { if ( empty ( $ str ) ) { throw new moodle_exception ( 'error' ) ; } $ parts = explode ( '&' , $ str ) ; $ result = array ( ) ; foreach ( $ parts as $ part ) { list ( $ k , $ v ) = explode ( '=' , $ part , 2 ) ; $ result [ urldecode ( $ k ) ] = urldecode ( $ v ) ; } if ( empty ( $ result ) ) { throw new moodle_exception ( 'error' ) ; } return $ result ; }
A method to parse oauth response to get oauth_token and oauth_token_secret
@param string $str
@return array
A method to parse oauth response to get oauth_token and oauth_token_secret