php - display data from the array using foreach -


having 3 columns in table column values stored in array. table

id   bill_id         description               quantity             amount  16    16           ["item1","item2","item3"]     ["2","1","2"]      ["100","100","150"] 

and code view result

    <?php $description=json_decode($result->description)?>     <?php $amount=json_decode($result->amount)?>     <?php $quantity=json_decode($result->quantity);?>        <?php foreach($description $row){?>        <tr class="item-row">          <td class="description"><textarea class="textarea" name="description[]"><?php echo $row;?></textarea></td>        <td><textarea name="amount[]" class="cost textarea"><?php echo $amount;?></textarea></td>        <td><textarea name="quantity[]" class="qty textarea"><?php echo $quantity;?></textarea></td>        <td><span class="price"></span></td>   </tr>   <?php }?> 

i want see result while using foreach

            description        amount           quantity              item1               2               100              item2               1               100              item3               2               150 

if give foreach amount , quantity result coming repeatedly


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -