Initially if there was one item in the list it would return an object rather than an array of one object. I fixed that using:
https://eirikhoem.wordpress.com/2008/03/13/array-problems-with-soap-and-php-updated/
$x = new SoapClient($wsdl, array('features' => SOAP_SINGLE_ELEMENT_ARRAYS));
But I'm having problems when there is no items in the list.
The best I've come up with so far is:
$occulist = $result->GetWebOccurrencesResult->OccuList;
if (!empty((array)($occulist))) {
foreach($occulist->TOccu as $occurrence) {
echo $occurrence->Prog_Name . ' running from ' . $occurrence->StartDate . ' to ' . $occurrence->EndDate . '<br/>';
}
}
Originally it was
foreach($result->GetWebOccurrencesResult->OccuList->TOccu as $occurrence) {