Re: How to access in C a parameter that is an array?
| From: | Sterling Hughes | Date: | Thu, 05 Oct 2000 15:04:31 +0000 |
| Subject: | Re: How to access in C a parameter that is an array? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-34318@lists.php.net to get a copy of this message | ||
Looping through a simple array:
PHP_FUNCTION(simple_loop)
{
zval **current, **zval_ar;
HashTable *ar;
if (ZEND_NUM_ARGS() != 1 ||
zend_get_parameters_ex(1, &zval_ar) == FAILURE) {
WRONG_PARAM_COUNT;
}
ar = HASH_OF(*zval_ar);
for (zend_hash_internal_pointer_reset(ar);
zend_hash_get_current_data(ar, (void **)¤t) == SUCCESS;
zend_hash_move_forward(ar)) {
SEPARATE_ZVAL(current);
convert_to_string_ex(current);
php_printf("%s", Z_STRVAL_PP(current));
}
}
-Sterling
> I am writing an extension module with a function that should accept a
> parameter that is an array. How do I access this array?
>
> The documentation tells me about creating an array (add_next_index_long
> etc.) but how do I read?
>
>
> Thank for your help!
>
> _________________________________________________________
> Joacim Zschimmer (030) 3470 2520 tel j@zsch.de
> Zschimmer Software +49 (30) 3470 2521 fax
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>