I using bootstrap datatables to display data from an API in a table. Here is the data:
{
\"response_status\": {
\"status_code\": 0,
\"status_message\":
Considering your data is stored in some variable say $your_data... Use json_decode($your_data,true) to get the data in array format... then loop the array
Assume that your data is stored in $data variable, your code should be like this:
<table>
<thead>
<tr>
<th>Reg No</th>
<th>Company</th>
<th>Office</th>
<th>Phone Number</th>
<th>Postal Address</th>
<th>Postal Code</th>
</tr>
</thead>
<tbody>
<?php foreach($data->response_status->status_message as $message) : ?>
<tr>
<td><?php echo $message->reg_number; ?></td>
<td><?php echo $message->company; ?></td>
<td><?php echo $message->office; ?></td>
<td><?php echo $message->phone_number; ?></td>
<td><?php echo $message->postal_address; ?></td>
<td><?php echo $message->postal_code; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
<table>