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