Re: Re: Arrays and arrays of arrays....
| From: | Pierre Ancelot | Date: | Sat, 13 Nov 2004 01:27:55 +0000 |
| Subject: | Re: Re: Arrays and arrays of arrays.... | ||
| References: | 1 2 3 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-1614@lists.php.net to get a copy of this message | ||
I think i didn't explain what was wrong in that i did.
so will i :)
i call my function this way :
$requests = array(array("test1", "test2"), array("test3",
"test4"));
my_function($requests);
and the code is:
zval **urls;
//long url_len;
int number_of_calls, i, error_code;
CURLM *multi_handle;
CURL *http_get_handle;
if(ZEND_NUM_ARGS() != 1)
WRONG_PARAM_COUNT;
if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &urls) ==
FAILURE)
RETURN_EMPTY_STRING();
zend_printf("%s Arg\n", Z_ARRVAL_PP(Z_STRVAL_P(urls)));
i think by trying and trying i mix up everything in my mind. may someone
please show me how to retrieve test1, test2, test3 and test4 please ?
Thank you
On Saturday 13 November 2004 00:34, Pierre Ancelot wrote:
> Thanks a lot :)
>
> Isn't there a documentation for those functions ?
>
> On Saturday 13 November 2004 00:14, Sara Golemon wrote:
> > > i did this :
> > >
> > > zval *urls;
> > >
> > > if(ZEND_NUM_ARGS() != 1)
> > > WRONG_PARAM_COUNT;
> > > if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &urls) ==
> > > FAILURE)
> > > RETURN_EMPTY_STRING();
> > >
> > > zend_printf("%s Arg\n", urls->value.str.val);
> >
> > First off, let me say this is one of the reasons the macros are
> > recommended over accessing the zval structs directly :)
> >
> > You've got an array here, but you're accessing the portions of the zval
> > that relate to strings. Don't do that.
> >
> > Zend/zend_hash.h has every prototype you'll want to use with array
> > access, take a look at functions like stream_get_wrappers() for a quickie
> > sample of how to itterate through a simple array.
> >
> > > Erm.... 'm very lost on this... i been looking how print_r does but it
> > > calls a
> > > nApplyAccount thing that is not in the zval structure...
> >
> > print_r()/var_dump()'s approach is more comprehensive, if you have more
> > pointed questions, bring them up.
> >
> > -Sara