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


Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free