Article View: pl.comp.lang.php
Article #220151Re: tablica integerów jako parametry dla metody
From: desertman
Date: Tue, 18 Aug 2009 07:31
Date: Tue, 18 Aug 2009 07:31
34 lines
2233 bytes
2233 bytes
Arnold pisze:
>
> ok, ten przykład faktycznie zawiera błąd. Jednak zacytowany fragment to
> jedna z bardzo wielu desperackich prób poprawnego wstawienia tablicy
> jako parametru...
tak na szybko sprawdziłem dokumentację dla klasy xmlrpcval i chyba
problem leży w tym że tablica którą chcesz podać jako parametr przy
tworzeniu obiektu tej klasy musi składać się również z elementów klasy
xmlrpcval a nie integerów.
"$myVal=new xmlrpcval($arrayVal, "array" | "struct");
The constructor form can be used to compose complex XML-RPC values. The
first argument is either a simple array in the case of an XML-RPC array
or an associative array in the case of a struct. The elements of the
array must be xmlrpcval objects themselves. Examples:
$myArray=new xmlrpcval(array(
new xmlrpcval("Tom"), new xmlrpcval("Dick"),
new xmlrpcval("Harry")), "array");
"
czyli spróbuj twoją tablicę zdefiniować tak:
$p = array(new xmlrpcvalue(100, "int"), new xmlrpcvalue(200, "int"), new
xmlrpcvalue(300, "int"));
Powinno zadziałać, ale głowy uciąć sobie za to nie dam ;), bo nie
korzystałem nigdy z tej klasy.
--
desertman
Technical Details
Message-ID:
<h6dldv$j74$1@news.onet.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.nask.pl!news.nask.org.pl!news.onet.pl!not-for-mailReferences:
<h5uhb6$67g$1@nemesis.news.neostrada.pl> <h5uhbr$pto$1@atlantis.news.neostrada.pl> <h5vl4a$15pg$1@opal.icpnet.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.nask.pl!news.nask.org.pl!news.onet.pl!not-for-mail From: desertman <desertman@poczta.onet.pl> Newsgroups: pl.comp.lang.php Subject: Re: tablica integerów jako parametry dla metody Date: Tue, 18 Aug 2009 09:31:56 +0200 Organization: http://onet.pl Lines: 34 Message-ID: <h6dldv$j74$1@news.onet.pl> References: <h5uhb6$67g$1@nemesis.news.neostrada.pl> <h5uhbr$pto$1@atlantis.news.neostrada.pl> <h5vl4a$15pg$1@opal.icpnet.pl> NNTP-Posting-Host: abjt229.neoplus.adsl.tpnet.pl Mime-Version: 1.0 X-Trace: news.onet.pl 1250580735 19684 83.7.161.229 (18 Aug 2009 07:32:15 GMT) X-Complaints-To: niusy@onet.pl NNTP-Posting-Date: Tue, 18 Aug 2009 07:32:15 +0000 (UTC) User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) In-Reply-To: <h5vl4a$15pg$1@opal.icpnet.pl> X-Antivirus: avast! (VPS 090817-0, 2009-08-17), Outbound message X-Antivirus-Status: Clean Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit