note 86320 modified in ref.soap by felipe
| From: | felipe@php.net | Date: | Thu, 16 Oct 2008 01:05:17 +0000 |
| Subject: | note 86320 modified in ref.soap by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-145396@lists.php.net to get a copy of this message | ||
As you may find, SOAP functions return result of type stdClass, not array. It means that you'll
need to use $row->id instead of $row['id'] which may be inconvenient.
You can cast stdClass to array using this construction:
<?php
$data = $soap->getMyData($someParams);
$data = (array)$data;
print $data['field']; // now it works
?>
--was--
As you may find, SOAP functions return result of type stdClass, not array. It means that you'll
need to use $row->id instead of $row['id'] which may be inconvenient.
You can cast stdClass to array using this construction:
$data = $soap->getMyData($someParams);
$data = (array)$data;
print $data['field']; // now it works
http://php.net/manual/en/ref.soap.php