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."");

$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?


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


See why 200,000 companies worldwide love Campaign Monitor.

From Australia to Zimbabwe, and everywhere in between, companies count on Campaign Monitor for email campaigns that boost the bottom line.

Get started for free