优化PHP WSDL Soap客户端结果并导出到csv

时间:2018-04-03 20:37:49

标签: php soap soap-client

我创建了一个查询WSDL Soap服务的PHP脚本。我可以得到正确的结果返回。我想知道如何改进结果只显示一个值并且能够将这些值导出为CSV?这是我使用print_r($response)时返回的内容:

stdClass Object ( [data] => stdClass Object (
          [array] => stdClass Object (
                     [articleLinkages] => stdClass Object (
                                          [array] => Array (
                                                     [0] => stdClass Object (
                                                            [articleLinkId] => 18973666 
                                                            [linkingTargetId] => 29480 
                                                            [linkingTargetType] => P 
                                                            ) 
                                                     [1] => stdClass Object (
                                                            [articleLinkId] => 18973667 
                                                            [linkingTargetId] => 29481 
                                                            [linkingTargetType] => P 
                                                            ) 
                                                     [2] => stdClass Object (
                                                            [articleLinkId] => 18973683 
                                                            [linkingTargetId] => 29482 
                                                            [linkingTargetType] => P 
                                                            ) 
                                                     [3] => stdClass Object (
                                                            [articleLinkId] => 18973763 
                                                            [linkingTargetId] => 34928 
                                                            [linkingTargetType] => P 
                                                            ) 
                                                     [4] => stdClass Object (
                                                            [articleLinkId] => 18973699 
                                                            [linkingTargetId] => 29483 
                                                            [linkingTargetType] => P 
                                                            ) 
                                                     [5] => stdClass Object (
                                                            [articleLinkId] => 18973715 
                                                            [linkingTargetId] => 29484 
                                                            [linkingTargetType] => P 
                                                            )
                                                     [6] => stdClass Object (
                                                            [articleLinkId] => 18973731 
                                                            [linkingTargetId] => 29485 
                                                            [linkingTargetType] => P 
                                                            ) 
                                                     [7] => stdClass Object (
                                                            [articleLinkId] => 18973779 
                                                            [linkingTargetId] => 34929 
                                                            [linkingTargetType] => P 
                                                            ) 
                                                 ) 
                     ) 
          )  ) 
          [status] => 200  )

我只想查看linkingTargetId值。像这样。

29480,
29481,
29482,
34928,
29483,
29484,
29485,
34929,

并能够将这些导出到csv吗?这难以实现吗?

0 个答案:

没有答案