echo '<table border=\'0\' cellpadding=\'0\' cellspacing=\'0\'>';
for ($y=$startY;$y<$startY+$fieldHeight;$y++) {
echo '<tr>';
for ($x=$startX;$x<$startX+$fieldWidth;$x++) {
//echo '(' . $x . ',' . $y . ')';
echo '<td><img src=\'tiles/' . (isset($map[$x][$y]['terrain']) ? $map[$x][$y]['terrain'] : 'water') . '.png\' alt=\'\' /></td>';
}
echo '</tr>';
}
echo '</table>';
This data will be updated through jQuery calls. I am just looking for a simple way to store the output from the above in a variable. How can I do that?
Reference for ob_get_contents();