Re: [SOAP] StdClass Object returned from __soapCall???
| From: | Adam Maccabee Trachtenberg | Date: | Thu, 06 Jul 2006 16:36:00 +0000 |
| Subject: | Re: [SOAP] StdClass Object returned from __soapCall??? | ||
| References: | 1 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-2352@lists.php.net to get a copy of this message | ||
On Thu, 6 Jul 2006, Vandegrift, Ken wrote:
> Just wanted to check if anybody knows why the return values from a web
> service I am connecting with returns response values as a stdClass
> object instead of an associative array like I was expecting?
An object with only public properties and no methods is pretty much
the same thing as an array in PHP. You should be able to iterate over
it, etc.
However, if you prefer it as an array, typecast it:
$array = (array) $object;
-adam
--
adam@trachtenberg.com | http://www.trachtenberg.com
author of o'reilly's "upgrading to php 5" and "php cookbook"
avoid the holiday rush, buy your copies today!