You are here: Re: [PHP] PEAR::SOAP returns objects instead of associative arrays « PHP « IT news, forums, messages
Re: [PHP] PEAR::SOAP returns objects instead of associative arrays

Posted by William Lovaton on 10/03/85 11:07

Hi,

It works but in some cases. It works with this:
stdClass Object
(
[cod_tipo_identi] => 4
[des_identificacion] => REGISTRO CIVIL
[abr_identificacion] => RC
)

It convert it to an Array, but it doesn't work with this:
Array
(
[0] => stdClass Object
(
[cod_tipo_identi] => 1
[des_identificacion] => CEDULA CIUDADANIA
[abr_identificacion] => CC
)

[1] => stdClass Object
(
[cod_tipo_identi] => 2
[des_identificacion] => NRO. IDENTIF. TRIBUTARIA
[abr_identificacion] => NIT
)

[2] => stdClass Object
(
[cod_tipo_identi] => 3
[des_identificacion] => TARJETA DE IDENTIDAD
[abr_identificacion] => TI
)

[3] => stdClass Object
(
[cod_tipo_identi] => 4
[des_identificacion] => REGISTRO CIVIL
[abr_identificacion] => RC
)
)

I need the nested objects to be arrays and your suggestion won't do
the trick and I don't want to be iterating over the array to convert
the objects.

I was talking with some of the PEAR::SOAP maintainers and he told me
there is an option/constant that controls this behavior. Does any
one know where it is? I couldn't find it.

-William


El jue, 03-02-2005 a las 09:04 +0100, Jochem Maas escribió:
> William Lovaton wrote:
> > Hello,
> >
> > I just found out that since version 0.7, PEAR::SOAP returns stdClass
> > objects instead of associative arrays.
> > http://pear.php.net/package-changelog.php?pacid=87&release=0.7.3
> >
> > What is the reason for this? I _need_ to get associative arrays, how do
> > I revert to the old behavior?
>
> lets say that you have a return value from PEAR::SOAP in the variable $a....
> does the following give you what you need?:
>
> $a = (array) $a;
>
>
> >
> >
> > -William
> >
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация