php5 Soap WSDL Example

Hi there,

I'm new to mailbuild and setting up the first subscribe form using the mailbuild API. Everything works fine, but interpreting the result is breaking me. What I do now:

$client = new SoapClient("http://".$this->siteName.".createsend.com/api/api.asmx?wsdl");

$params->ApiKey = $this->apiKey;
$params->ListID = $list;
$params->Email = $email;
$params->Name = $name;

$result = $client->AddSubscriber($params);

list(,$moreResult) = each ($result);
$code = $moreResult->Code;
           
if ($code == 0)
....


It works, but seems very ugly to me (list, each, etc)? How can I access the Subscriber.AddResult Property of the $result object? I know, this is more of a php topic, but anyway, maybe someone had this problem before?

regards,
ben

ps: print_r($result):
stdClass Object
(
    [Subscriber.AddResult] => stdClass Object
        (
            [Code] => 1
            [Message] => Invalid email address
        )

)

200,000 companies around the world can't be wrong.

From Australia to Zimbabwe, and everywhere in between, companies count on 
Campaign Monitor for email campaigns that drive real business results.

Get started for free
1-888-533-8098