【发布时间】:2017-10-06 03:08:27
【问题描述】:
我已经尝试了一段时间,现在试图从这个 std 对象中获取一个值
stdClass::__set_state(array(
'regions' =>
array (
0 =>
stdClass::__set_state(array(
'id' => 1,
'name' => 'Canada',
'image_url' => 'https://s3-us-west-2.amazonaws.com/staticimageskiind/flags/CA@3x.png',
)),
1 =>
stdClass::__set_state(array(
'id' => 2,
'name' => 'USA',
'image_url' => 'https://s3-us-west-2.amazonaws.com/staticimageskiind/flags/US@3x.png',
)),
2 =>
stdClass::__set_state(array(
'id' => 3,
'name' => 'Global',
'image_url' => 'https://s3-us-west-2.amazonaws.com/staticimageskiind/flags/GLBL@3x.png',
)),
3 =>
stdClass::__set_state(array(
'id' => 4,
'name' => 'Australia',
'image_url' => 'https://s3-us-west-2.amazonaws.com/staticimageskiind/flags/AU@3x.png',
)),
),
'info' =>
stdClass::__set_state(array(
'code' => 'INFO_MARKETPLACE_RETRIEVED_REGIONS',
'name' => 'Marketplace Regions Retrieved',
'message' => 'A list of marketplace regions has been retrieved.',
)),
));
但我似乎无法从该对象中获取值,不胜感激,我在网上搜索但找不到解决方案
【问题讨论】:
-
我认为您使用的是 drupal ,请尝试使用 $VARIABLE->__get('regions');
-
您尝试使用
$object->regions吗?如果不尝试提供有关您已经尝试过的更多信息。