我想知道如何从下面显示的print_r中获取值 [英] I want to know how can I get the value from this print_r shown below

查看:48
本文介绍了我想知道如何从下面显示的print_r中获取值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是

print_r($ response-> Items-> Item-> EditorialReviews-> EditorialReview)

 Array
        (
            [0] => stdClass Object
                (
                    [Source] => Product Description
                    [Content] => Acer AO725-0899
                    [IsLinkSuppressed] => 
                )

            [1] => stdClass Object
                (
                    [Source] => Amazon.com Product Description
                    [Content] => Perfect portability, perfect usability: The Aspire® One AO725 N

我想从0到Content或1到Content获取值,如何获取呢?

I want to get the value from 0 to Content or 1 to Content , How can I get this?

推荐答案

只需遵循以下步骤即可:

Just keep following the chain:

$response->Items->Item->EditorialReviews->EditorialReview[0]->Content

$response->Items->Item->EditorialReviews->EditorialReview[1]->Content

从转储中查找所需数据的一般规则:

General rule to finding the data you want from a dump like this:

  1. 任何 Array([x] => ... 表示将 [0] 附加到变量中.

任何 Object([x] => ... 表示将-> x 附加到变量中.

Anything Object( [x] => ... means you append ->x to your variable.

这篇关于我想知道如何从下面显示的print_r中获取值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆