PHP calls WebService. could you please take a look at it ~

Source: Internet
Author: User
PHP calls WebService. could you please take a look at it ~
 '1','outCount'=>'10');$ret = $client->LatestNews($param);if($ret->return){  print_r($ret->return);}else{  echo 'no user';}?>



What's wrong with simple Webservice calls? Thank you for your guidance ~


Reply to discussion (solution)

Anyone? online.

Print_r ($ ret );
Get
StdClass Object
(
[LatestNewsResult] => stdClass Object
(
[InheritanceNews] => Array
(
[0] => stdClass Object
(
[Url] => http://pica.chalwin.com/cpzx/2013/278.html
[NewsCount] => 0
[Author] => larry
[Title] => website construction process
[NewsId] = & gt; 278
[PublishTime] => 2013-04-16T13: 34: 57
)
.....

No return member

Print_r ($ ret );
Get
StdClass Object
(
[LatestNewsResult] => stdClass Object
(
[InheritanceNews] => Array
(
[0] => stdClass Object
(
[Url] => http://pica.chalwin.com/cpzx/2013/278.html
[NewsCount] => 0
[Author] => larry
[Title] => website construction process
[NewsId] = & gt; 278
[PublishTime] => 2013-04-16T13: 34: 57
)
.....

No return member
So how can I output everything? It's not the set to output ~ Ah.

Anyone? online.
Is how to bind it to a table

$ Ret-> LatestNewsResult-> InheritanceNews is a subscript array.
Should this array be traversed?

foreach($ret->LatestNewsResult->InheritanceNews as $item) {  foreach($item as $k=>$v) {    echo "$k : $v\n";  }}

foreach($ret->LatestNewsResult->InheritanceNews as $item) {  foreach($item as $k=>$v) {    echo "$k : $v\n";  }}

Thanks, the results are Output. I will beautify others myself.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.