3v4l.org

run code in 300+ PHP versions simultaneously
<?php // price matrix: first index is y-axis, second is x-axis $prices = [ 600 => [ 600 => 224, 700 => 246, 800 => 266, 900 => 291, 1000 => 313 ], // here you put the rest... ]; //then echo the table; echo "<table><tr>"; echo "<td></td>"; // first empty cell; foreach ($prices[array_keys($prices)[0]] as $y_axis => $xprices){ echo "<td>".$y_axis."</td>"; } echo "</tr>";//finish setting up the header foreach ($prices as $y_axis => $xprices) { echo "<tr>"; echo "<td>".$y_axis."</td>"; foreach($xprices as $y_axis=> $price){ echo "<td>".$price."</td>"; } echo "</tr>"; } echo "</table>";

preferences:
50.53 ms | 402 KiB | 5 Q