Elimde bir json verisi var. Bunu nasıl yazdırabilirim?
[["Besin Deu011feri","100 Gramda","Gu00fcnlu00fck Deu011fer*"],["Kalori","564 kcal","% 27.2"],["Karbonhidrat","24 g","% 7.8"],["Lif","15 g","% 63.3"],["Protein","11 g","% 22.4"],["Yau011f","44 g","% 67.1"],["Doymuu015f Yau011f","27 g",""],["u015eeker","18 g","% 60.0"]]
Php json yazdirma sorunu
3
●98
- 04-02-2023, 13:33:01
<!DOCTYPE html> <html> <head> <style> table{font-family: arial, sans-serif;border-collapse: collapse;width: 100%;} td, th {border: 1px solid #dddddd;text-align: left;padding: 8px;} tr:nth-child(even) {background-color: #dddddd;} </style> </head> <body> <?php $file = json_decode(file_get_contents('test.json')); echo '<table>'; foreach($file as $x){ echo '<tr>'; foreach($x as $xx){ echo '<td>'.$xx.'</td>'; } echo '</tr>'; } echo '</table>' ?> </body> </html>