HTML Table from .json file [closed]

So I’m really new to working with json files and coding in general. I’ve tried to wrap my head around this problem for hours now and I can’t find any solution to it.

I have this .json file and want to make a HTML table from it:

         "Webadded cmds are working!",
         "This is only for Streamers!",
         "This is only for Admins!",
         "This is only for mods",
         "I love you",

It should look a little bit like this:

cmd_name cmd rights
web Webadded cmds are working! 1

I don’t need the “doggo_counter” or “admins” part of the file. Just the “template_commands. Is this even possible with that kind of file?


$objs = json_decode(file_get_contents('data.json'),true);
$commands = $objs['template_commands'];
echo "<table border='1'>"; //table bordered
echo "<tr><th>cmd_name</th><th>cmd</th><th>Rights</th></tr>"; //the header of table
foreach($commands as $cmd_name => $cmds) {
    echo "<tr><td>$cmd_name</td>
    <td>".preg_replace('/[^0-9]+/','', $cmds[1])."</td></tr>";//only digits
echo "</table>";