I have the following code, which currently displays the array values in resArr and resArr2 separately. I would like to display this data in a table, showing the value of array resArr in column 1 and the value of resArr2 in column 2. I have tried experimenting with tr and td however for some reason this has no effect on the output.
Could anyone provide me with any possible solution please?
$resArr = json_decode($res, 1);
$resArr2 = json_decode($res2, 1);
foreach ($resArr as $key => $value)
{
echo "<tr>";
if(!is_array($value))
{
if($key == 'attire' or $key == 'category' or $key == 'location' or $key == 'name' or $key == 'website' or $key == 'checkins' or $key == 'likes')
{
echo "<td>";
echo $key . ':' . $value;
echo "<br />\n";
echo "</td>";
}
}
echo "</tr>";
}
foreach ($resArr2 as $key => $value)
{
//to eliminate array to string conversion error
if(!is_array($value))
{
if($key == 'attire' or $key == 'category' or $key == 'location' or $key == 'name' or $key == 'website' or $key == 'checkins' or $key == 'likes')
{
echo $key . ':' . $value;
echo "<br />\n";
}
}
}
