Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4722 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8897 invoked by uid 1010); 7 Oct 2003 12:46:42 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 8796 invoked from network); 7 Oct 2003 12:46:42 -0000 Received: from unknown (HELO mx.thebrainroom.net) (65.200.24.98) by pb1.pair.com with SMTP; 7 Oct 2003 12:46:42 -0000 Received: by mx.thebrainroom.net (Postfix, from userid 517) id DEA68148808C; Tue, 7 Oct 2003 05:45:17 -0700 (PDT) Received: from zaneeb.thebrainroom.net (zaneeb.thebrainroom.net [82.133.1.138]) by mx.thebrainroom.net (Postfix) with ESMTP id DA4A71488087; Tue, 7 Oct 2003 05:45:06 -0700 (PDT) Received: from titan (titan.thebrainroom.net [82.133.1.139]) by zaneeb.thebrainroom.net (8.11.6/8.11.6) with SMTP id h97CkUK17229; Tue, 7 Oct 2003 13:46:30 +0100 Message-ID: <01ef01c38cd1$04940990$8b018552@titan> To: "netcat" , "PHP Development" References: <3F82B401.3070309@abox.co.il> Date: Tue, 7 Oct 2003 13:46:24 +0100 Organization: The Brain Room Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.3790.0 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0 X-Spam-Status: No, hits=-0.5 required=5.0 tests=AWL,REFERENCES version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) X-TBR-Filter: Virus scanned and defanged Subject: Re: [PHP-DEV] help request: php array From: wez@thebrainroom.com ("Wez Furlong") Try something like this: if (rep_CONSP(in)) { array_init(return_value); /* sets it up as an array */ for (i = in; i != Qnil; i = rep_CDR(i)) { zval *tmp; MAKE_STD_ZVAL(tmp); rep_data_converter(rep_CAR(i), tmp); add_next_index_zval(return_value, tmp); /* equivalent to $ret[] = $tmp */ } } > if(rep_CONSP(in)) { > zval php_array; > //zend_hash_init(&php_array,100, > repv i,t; > for(i=in;i!=Qnil;i=rep_CDR(i)) { > printf("REP FWD to next element\n"); > rep_data_converter(rep_CAR(i),&t); > /* ??? add t to array php_array */ > } > }