I'd do something like this...
<?php
$data = [
'46.105.73.18:27015' => [
'gq_address' => '46.105.73.18',
'gq_dedicated' => '',
'gq_gametype' => '',
'gq_hostname' => '',
'gq_joinlink' => 'steam://connect/46.105.73.18:27015/' ,
'gq_mapname' => '',
'gq_maxplayers' => '',
'gq_mod' => '',
'gq_name' => 'Counter-Strike: Source' ,
'gq_numplayers' => '',
'gq_online' => '',
'gq_password' => '',
'gq_port_client' => 27015 ,
'gq_port_query' => 27015 ,
'gq_protocol' => 'source' ,
'gq_transport' => 'udp' ,
'gq_type' => 'css' ,
'players' => Array (),
'teams' => Array ()
]
] ;
$tdata = '';
foreach ($data as $k => $v) {
$v = array_filter($v); // get rid of blank values
$tdata .= "<table border='1'>
<tr><th>Array key</th><th>" . join('</th><th>', array_keys($v)) . "</th></tr>\n"; // output headings
$tdata .= "<tr><th class='rowth'>$k</th><td>" . join('</td><td>', array_values($v)) . "</td></tr> // output values
</table>\n";
}
?>
<html lang='en'>
<head>
<meta 'charset'='utf-8'>
<title>Example</title>
<style type='text/css'>
table {
border-collapse: collapse;
margin-bottom: 10px;
}
th {
background-color: #444;
color: white;
padding: 8px;
}
.rowth {
background-color: #888;
}
td {
padding: 8px;
text-align: center;
}
</style>
</head>
<body>
<?= $tdata ?>
</body>
</html>
Giving ...