note 78707 added to function.soap-soapclient-soapcall
| From: | stefan at datax dot biz | Date: | Wed, 24 Oct 2007 14:28:32 +0000 |
| Subject: | note 78707 added to function.soap-soapclient-soapcall | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-131686@lists.php.net to get a copy of this message | ||
The call to __soapCall returned an object to me either. This is the function which makes my life
easier:
function obj2array($obj) {
$out = array();
foreach ($obj as $key => $val) {
switch(true) {
case is_object($val):
$out[$key] = obj2array($val);
break;
case is_array($val):
$out[$key] = obj2array($val);
break;
default:
$out[$key] = $val;
}
}
return $out;
}
Usage:
...
$response = $client ->__soapCall("track", array('parameters' =>
$request));
$response = obj2array($response);
Hope it helps.
----
Server IP: 195.46.80.5
Probable Submitter: 195.168.126.9
----
Manual Page -- http://www.php.net/manual/en/function.soap-soapclient-soapcall.php
Edit -- https://master.php.net/note/edit/78707
Del: integrated -- https://master.php.net/note/delete/78707/integrated
Del: useless -- https://master.php.net/note/delete/78707/useless
Del: bad code -- https://master.php.net/note/delete/78707/bad+code
Del: spam -- https://master.php.net/note/delete/78707/spam
Del: non-english -- https://master.php.net/note/delete/78707/non-english
Del: in docs -- https://master.php.net/note/delete/78707/in+docs
Del: other reasons-- https://master.php.net/note/delete/78707
Reject -- https://master.php.net/note/reject/78707
Search -- https://master.php.net/manage/user-notes.php