PHP 5x5 table with numbers in them


I'm a beginner at PHP and I have the following issue: I need to create a 5x5 table in PHP like this:

http://shrani.si/f/3p/5W/4BNOssVD/5x5matrix.jpg

This is what I have so far:

echo '<table border="1" style="width:100px">';
    for ($i=0; $i < 5; $i++) {      
        echo "<tr>";
            for ($j=0; $j < 5; $j++) { 
                echo "<td>";                
                    echo $j;
                echo "</td>";
                }
        echo "</tr>";
    }
echo "</table>";

Answers:


Change echo $j; to:

echo ($i*5) + $j + 1;