Array ( [Screens] =>
Array ( [0] =>
Array ( [ SPKRS ] =>
Array ( [price] => 455
[quantity] => 3
[image] =>
)
)
) [Software] => Array
( [0] => Array
( [Pricing] =>
Array ( [price] => 2
[quantity] => 2
[image] => SOFTWARE.png
[ALDELO FOR RESTAURANTS] => Array
( [price] => 535
[quantity] => 1
[image] =>
) ) ) [Networking] => Array
....
数组是$ products
<?php foreach ($products as $product): ?>
<div class="box-active">
<div class="line">
<div class="text left">
<p><?php print key($product); ?></p>
它为所有三个
打印0答案 0 :(得分:3)
试试这个:
<?php foreach ($products as $key => $product): ?>
<div class="box-active">
<div class="line">
<div class="text left">
<p><?php print $key; ?></p>