在 PHP 中访问关联数组
我想访问 PHP 中
$variables["thelistitems"];
print_r($variables["thelistitems"]);
Output下面的关联数组中的索引“memo”
Array
(
[0] => Array
(
[productid] => prod:c6dbdd62-dc13-6421-5a94-c8cd871a59d3
[memo] => dummy
[taxable] => 0
[unitweight] => 0
[unitcost] => 450.02
[unitprice] => 445.02
[quantity] => 1
)
)
I want to access the index 'memo' in the associative array in PHP below
$variables["thelistitems"];
print_r($variables["thelistitems"]);
Output
Array
(
[0] => Array
(
[productid] => prod:c6dbdd62-dc13-6421-5a94-c8cd871a59d3
[memo] => dummy
[taxable] => 0
[unitweight] => 0
[unitcost] => 450.02
[unitprice] => 445.02
[quantity] => 1
)
)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您本质上拥有的是关联数组的数组。因此,要访问第一个备忘录,要
访问每个备忘录,您需要执行以下操作
What you essentially have is an array of associative arrays. So to access the first memo, it's
To access each memo, you'd do something like this
你想要这个吗?
Do you want this ?