我有一个这种格式的数组
stdClass Object
(
[uid] => 245
[status] => 1
[filename] => test_image.png
[uri] => temporary://test_image.png
[filemime] => image/png
[filesize] => 58140
[source] => upload
[destination] => temporary://test_image.png
[fid] => 3312
[timestamp] => 1394177272
[type] => image
[field_replacement] => stdClass Object
(
[uid] => 245
[status] => 1
[filename] => test_image.png
[uri] => temporary://test_image.png
[filemime] => image/png
[filesize] => 58140
[source] => upload
[destination] => temporary://test_image.png
[fid] => 3312
[timestamp] => 1394177272
[type] => image
[field_replacement] => stdClass Object
(
[uid] => 245
[status] => 0
[filename] => test_image.png
[uri] => temporary://test_image.png
[filemime] => image/png
[filesize] => 58140
[source] => upload
[destination] => temporary://test_image.png
[fid] => 3312
[timestamp] => 1394177272
[original] => stdClass Object
(
[fid] => 3312
[uid] => 245
[filename] => test_image.png
[uri] => temporary://test_image.png
[filemime] => image/png
[filesize] => 58140
[status] => 1
[timestamp] => 1394177135
[type] => image
[rdf_mapping] => Array
(
)
)
[type] => image
)
**[original] => stdClass Object
(
[fid] => 3312
[uid] => 245
[filename] => test_image.png
[uri] => temporary://test_image.png
[filemime] => image/png
[filesize] => 58140
[status] => 0
[timestamp] => 1394177272
[type] => image
[rdf_mapping] => Array
(
)
)**
)
)
现在需要检索此值
**[original] => stdClass Object
(
[fid] => 3312
[uid] => 245
[filename] => test_image.png
[uri] => temporary://test_image.png
[filemime] => image/png
[filesize] => 58140
[status] => 0
[timestamp] => 1394177272
[type] => image
[rdf_mapping] => Array
(
)
)**
如何在php中完成它。
答案 0 :(得分:2)
$original = $object->field_replacement->original;
var_dump($original);
答案 1 :(得分:2)
这不是PHP数组。这是一个php对象。因此,您可以使用箭头( - >)进行如下访问。
$your_object->field_replacement->original