I get data array make me confuse like this:
{
"error":0,
"productcount":"1",
"page":1,
"totalpage":1,
"result":[sorry hidden cust request]
}
I want to convert it to html table, how ? please help me...
I get data array make me confuse like this:
{
"error":0,
"productcount":"1",
"page":1,
"totalpage":1,
"result":[sorry hidden cust request]
}
I want to convert it to html table, how ? please help me...
Just iterate over your result like so, note that the data you show is a JSON object, which you need to convert to an array first:
<?php
// this has to be in JSON format
$dataArray = json_decode($yourJSON);
$dataArray = $dataArray["result"][0]["stok"];
?>
<table>
<tr>
<td><strong>Ukuran</strong></td>
<?php foreach($dataArray as $item){?>
<td> <?= $item["ukuran"] ?> </td>
<?php } ?>
</tr>
<tr>
<td><strong>Stok</strong></td>
<?php foreach(dataArray as $item){?>
<td> <?= $item["stok"] ?> </td>
<?php } ?>
</tr>
</table>