How can JSON data be displayed in a table using PHP?

To display JSON data in a table using PHP, you can first decode the JSON string using `json_decode()`, loop through the data, and output it in an HTML table format.

<?php
$json_data = '[{"id":1,"name":"John","age":30},{"id":2,"name":"Jane","age":25},{"id":3,"name":"Bob","age":35}]';

$data = json_decode($json_data, true);

echo '<table border="1">';
echo '<tr><th>ID</th><th>Name</th><th>Age</th></tr>';

foreach ($data as $row) {
    echo '<tr>';
    echo '<td>' . $row['id'] . '</td>';
    echo '<td>' . $row['name'] . '</td>';
    echo '<td>' . $row['age'] . '</td>';
    echo '</tr>';
}

echo '</table>';
?>