This is my code which, when executed, brings me only the first two values of the json, the other data does not recognize it and I do not know how to solve it, I am trying but I do not succeed
<!--este es el json del cual debo extraer los valores y pasarlos a una tabla html -->
<?php
$jsonobj = '{ "codigo" : " 00 " ,
"descripcion" : " Consulta exitosa " ,
"movimientos" : [
{
"comercio_desc" : " ATIPICO RIVERA " ,
"fch_com" : " 05/01/21 " ,
"importe" : " 10000 " ,
"mov_tp" : " D " ,
"referencia_nro" : " 100530994259 " ,
"tarjeta" : " 6274311750000090 "
}
]}';
$decodedJson = json_decode($jsonobj, true);
?>
//esta es la tabla el cual deberia recibir los valores del json
<table id="tblUsuarios" class="table table-striped table-bordered table-td-valign-middle" cellspacing="0" width="100%;">
<thead>
<tr>
<th class="hidden-sm text-center">Codigo</th>
<th class="hidden-sm text-center">descripcion</th>
<th class="hidden-sm text-center">comercio_desc</th>
<th class="hidden-sm text-center">fch_com</th>
<th class="hidden-sm text-center">importe</th>
<th class="hidden-sm text-center">mov_tp</th>
<th class="hidden-sm text-center">referencia_nro</th>
<th class="hidden-sm text-center">tarjeta</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-nowrap text-inverse text-center"> <?php echo $decodedJson["codigo"] ; ?> </td>
<td class="text-nowrap text-inverse text-center"> <?php echo $decodedJson["descripcion"] ; ?></td>
<td class="f-w-600 text-muted text-center"><?php echo $decodedJson["comercio_desc"] ; ?> </td>
<td class="f-w-600 text-muted text-center"><?php echo $decodedJson["fch_com"] ; ?> </td>
<td class="f-w-600 text-muted text-center"><?php echo $decodedJson["importe"]; ?> </td>
<td class="f-w-600 text-muted text-center"> <?php echo $decodedJson["mov_tp"]; ?></td>
<td class="f-w-600 text-muted text-center"> <?php echo $decodedJson["referencia_nro"]; ?></td>
<td class="f-w-600 text-muted text-center"><?php echo $decodedJson["tarjeta"]; ?> </td>
</td>
</tr>
</tbody>
</table>
I have managed to get the data with this loop now I need to filter it by date, again I fell short with json, could someone give me a hand please?
for ($i=0; $i <count($decodedJson["movimientos"]); $i++) {
?>
// Here you show the records of your table
I think you need to include the item "movements"