我试图弄清楚为什么我无法使用以下语句访问跟随数组:
var_dump($thevar[0]['product_id']);
Array
(
[d142d425a5487967a914b6579428d64b] => Array
(
[product_id] => 253
[variation_id] =>
[variation] =>
[quantity] => 1
[data] => WC_Product Object
(
[id] => 253
[product_custom_fields] => Array
(
[_edit_last] => Array
(
[0] => 1
)
[_edit_lock] => Array
(
[0] => 1345655854:1
)
[_thumbnail_id] => Array
(
[0] => 102
)
但是,我可以使用动态创建的数组名称访问“product_id”:
print_r($thevar['d142d425a5487967a914b6579428d64b']['product_id']);
问题是,我不知道动态名称将是什么...