I’m sure you have run into this before. if an Element is defined in the Soap WSDL and a single element is returned - it is treated as an object in the Soap Results, and not an array.
Turns out there is a quick fix:
$x = new SoapClient($wsdl, array(’features’ =>
SOAP_SINGLE_ELEMENT_ARRAYS));
Thats it. If a single element is returned, PHP will handle this is a single element array, and not as an object! Handy to avoid all those if( is_object()) elseif( is_array()) constructs in your code!