That simple, huh?

What can I say - You are the man!

Thanx

Rasmus Lerdorf wrote:
> 
> Ah, ok.  It's not much harder:
> 
>   pval *tmp_arr;
> 
>   array_init(return_value);
>   MAKE_STD_ZVAL(tmp_arr);
>   array_init(tmp_arr);
>   add_assoc_string(tmp_arr, "string index", "foo", 1);
>   zend_hash_index_update(Z_ARRVAL_P(return_value), 5, &tmp_arr, sizeof(tmp_arr), 
>NULL);
> 
> This will create  $whatever[5]['string index'] = 'foo'
> 
> Or if you want a string index at the top level:
> 
>   zend_hash_update(Z_ARRVAL_P(return_value), "bar", strlen("bar")+1, &tmp_arr, 
>sizeof(tmp_arr), NULL);
> 
> This will create  $whatever['bar']['string index'] = 'foo';
> 
> -Rasmus


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to