如何访问这个数组

How to access this array

array (
  '_attributes' => 
  array (
    'name' => 'Rothco Product API - Variations',
  ),
  'item_variations' => 
  array (
    0 => 
    stdclass::__set_state(array(
       'item_variation_id' => 2,
       'item_index' => 3146,
       'rothco_item_no' => '10002',
       'upc' => '023063601212',
       'inventory' => 99,
       'created_date' => '2014-11-28 10:06:45.000',
       'weight' => '.4000',
       'image_filename' => '10002-A.jpg',
       'catalog_page_no' => 183,
       'msrp' => '20.9900',
       'map' => '.0000',
       'diameter' => '',
       'price' => '8.100000',
       'case_price' => NULL,
       'case_quantity' => NULL,
       'statuses' => '',
    )),
  ),
)

这是我的数组 $list。

我想访问此数组中的 'item_variations' 值,

但如果我尝试 $list['item_variations'],或 $list->['item_variations']

它不工作

如果您只想达到 item_variations,那么

echo $list['item_variations'];

足够了。如果你想从你的样本数据中获取价值,因为你混合了数组和对象,所以需要不同的访问:

echo $list['item_variations'][0]->created_date;

会输出

2014-11-28 10:06:45.000