Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4719 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93971 invoked by uid 1010); 7 Oct 2003 12:35:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 93936 invoked from network); 7 Oct 2003 12:35:48 -0000 Received: from unknown (HELO mail.sites-secure.com) (213.189.34.71) by pb1.pair.com with SMTP; 7 Oct 2003 12:35:48 -0000 Received: by mail.sites-secure.com (CommuniGate Pro PIPE 3.5.9) with PIPE id 31179257; Tue, 07 Oct 2003 13:42:42 +0200 Received: from [192.117.106.24] (account ilya@up.co.il HELO abox.co.il) by mail.sites-secure.com (CommuniGate Pro SMTP 3.5.9) with ESMTP id 31179258 for internals@lists.php.net; Tue, 07 Oct 2003 13:42:38 +0200 Message-ID: <3F82B401.3070309@abox.co.il> Date: Tue, 07 Oct 2003 14:39:29 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3; MultiZilla v1.3.1 (a)) Gecko/20030917 X-Accept-Language: en-us, en, he, ru MIME-Version: 1.0 To: PHP Development X-Enigmail-Version: 0.76.7.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-DoalSignature: rot-1 (smtp) Subject: help request: php array From: netcat@abox.co.il (netcat) Hi internals. After looking at "Zend/zend_hash.h" e.t.c and haven't realizing how should i do that,i'm asking for your help. It should be really simple for you .... Have the following function: it should recursively convert data from rep_XXX to php data It does that for string and numbers for now. It's time to ad an array and hash. The question is near "???". (and another one - how this would look like for adding hash elements (excluding the rep_XXX stuff of course)) int rep_data_converter(repv in,zval *return_value) { if(rep_STRINGP(in)) { //printf("REP Will return string\n"); RETVAL_STRING (rep_STR(in),1); return 1; } if(rep_INTP(in)) { RETURN_LONG (rep_INT(in)); return 1; } if(rep_LONG_INTP(in)) { RETURN_LONG (rep_LONG_INT(in)); return 1; } // hadle array 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 */ } } RETVAL_STRING("REP: Unsupported type yet\n",1); return 0; } Thanks in advance. -- NetCat -------------------------------------------------- FREE 10MB Email + Antivirus + POP3 + more... Get it at http://www.doal.co.il:81/free/?c=antivirus