X,Y coordinate PHP
<p>Im building some map, that will get the Player location from X,Y coordinate. But I am thinking of how I can keep the "same" map, until I actually hit some kind of edge, with my X,Y coordinate. Cause, right now with my code, I will stay in the top left corner, whenever I move.</p>

<pre><code>&lt;?php
$startX = 2;
$startY = 5;

$fieldHeight = 6;
$fieldWidth = 6;

$player[2][5] = 1;


echo "&lt;table&gt;";
for ($y=$startY; $y&lt;$startY+$fieldHeight; $y++) {
   echo "&lt;tr&gt;";
   for ($x=$startX; $x&lt;$startX+$fieldWidth; $x++) {
       echo "&lt;td&gt;";
        if (isset($player[$x][$y])) {
            echo "UID: " . $player[$x][$y];
        } else {
            echo "(" . $x . ", " . $y . ")";
        }
       echo "&lt;/td&gt;";
   }
   echo "&lt;/tr&gt;";
}
echo "&lt;/table&gt;";
</code></pre>

<p>Any idea how I can make modify my current code, or any hint of how I am gonna do it, I am lost.</p>
