Re: Re: Arrays and arrays of arrays....
| From: | Pierre Ancelot | Date: | Fri, 12 Nov 2004 23:34:53 +0000 |
| Subject: | Re: Re: Arrays and arrays of arrays.... | ||
| References: | 1 2 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-1613@lists.php.net to get a copy of this message | ||
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