0
Well I have a variable $curva
that I counted a array
, if I’m a var_dump
the result is this:
array (size=6)
0 =>
array (size=4)
'id' => string '107' (length=3)
'nome' => string 'LAREIRA PEQ.' (length=12)
'qtd' => float 43
'total' => float 64500
1 =>
array (size=4)
'id' => string '108' (length=3)
'nome' => string 'CHORAQUERIA PEQ.' (length=16)
'qtd' => float 60
'total' => float 48000
2 =>
array (size=4)
'id' => string '109' (length=3)
'nome' => string 'JOGO DE FACAS' (length=13)
'qtd' => float 90
'total' => float 27000
3 =>
array (size=4)
'id' => string '111' (length=3)
'nome' => string 'PROVALEIRA' (length=10)
'qtd' => float 100
'total' => float 6000
4 =>
array (size=4)
'id' => string '110' (length=3)
'nome' => string 'COOLERS' (length=7)
'qtd' => float 84
'total' => float 21000
5 =>
array (size=4)
'id' => string '112' (length=3)
'nome' => string 'CHAMPANHEIRA' (length=12)
'qtd' => float 28
'total' => float 1962.64
I tried to do so:
foreach ($curva as $c) {
?>
<tr>
<td><?= $c->id ?></td>
<td><?= $c->nome ?></td>
<td><?= $c->qtd ?></td>
<td><?= $c->total ?></td>
</tr>
<?php
}
But it’s not working. Someone knows what it might be?
<td><?= $c['id'] ?></td>
works?– rray
mayor worked out right here, thank you
– Hugo Borges