Re: Returning multi-dimensional array
| From: | Andrei Zmievski | Date: | Mon, 15 May 2000 13:35:39 +0000 |
| Subject: | Re: Returning multi-dimensional array | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-18761@lists.php.net to get a copy of this message | ||
On Mon, 15 May 2000, adam@indexdata.dk wrote:
> Hi,
>
> looking at the ZEND API it's not obvious to me how I return a multi-
> dimensional array (from C). If anybody could provide information and/or
> sample code that would be great.
You do array_init(return_value) first. Then for each inner array you
allocate a zval*, initialize it, add data to it, and add it to the
return value.
-Andrei
"I think it would be a good idea." -- Mahatma Gandhi,
when asked what he thought of Western civilization...