WSDL输出到PHP var?

时间:2018-01-05 07:20:38

标签: php xml wsdl

我从WSDL源获取此输出。 现在我想将所有部分保存在PHP变量中。 但是我怎么能分开这个大事呢?的foreach?任何的想法? 我想将所有信息都包含在不同的变量中。

$ response中的所有数据..

$response = $client->getAllEventInfos('12345');
print_r($response);

那就是输出......

stdClass Object ( 
[beautifulDate] => 01.05.2018 20:00 - 21:00 
[concernedPersons] => Array ( 
[0] => stdClass Object ( 
    [item] => Array ( 
        [0] => John Doe 
        [1] => Vortragender 
        [2] => ) ) ) 
[eventPool] => stdClass Object ( 
    [id] => 1 
    [institutionName] => ASM Rechnungen 
    [name] => ASM ) 
    [eventdates] => Array ( 
        [0] => stdClass Object ( 
            [item] => Array ( 
                [0] => 01.05.2018 von 20:00 bis 21:00 
                [1] => Zwettl 
                [2] => 01.05.2018 20:00 
                [3] => 01.05.2018 21:00 ) ) ) 
[fullyBooked] => 
[id] => 10011 
[name] => Besuch des Präsidenten 
[registrationEndDate] => 25.12.2018 
[registrationLink] => https:example.com 
[registrationStartDate] => 01.01.2018 
[startDate] => 01.05.2018 
[wsEventDates] => Array ( 
    [0] => stdClass Object ( 
        [beginTime] => 01.05.2018 20:00 
        [endTime] => 01.05.2018 21:00 
        [periode] => 01.05.2018 von 20:00 bis 21:00 
        [venueName] => Zwettl ) ) 
[iCalLink] => https://example.com )

1 个答案:

答案 0 :(得分:0)

这是您评论的回复

循环relatedPersons数组,如:

foreach($response->concernedPersons as $person) {
      foreach($person->item as $item){
            echo $item."<br>";
      }

}