<?php
$array[0][0] = '1';
$i = 0;
foreach($array as $keyX => $x) {
foreach($x as $keyY => $y) {
//Желаеш изменить данный элент массива, тогда к нему и обращайся. По соответствующим координатам.
$array[$keyX][$keyY] = $i;
$i++;
}
}
foreach ($array as $y => $x) {
foreach ($x as $key => $value) {
echo ' ' . $value . ' ';
}
echo "\n";
}
PD9waHAKJGFycmF5ID0gYXJyYXlfZmlsbCgwLCAxMCwgYXJyYXlfZmlsbCgwLCAxMCwgJ18nKSk7CgokYXJyYXlbMF1bMF0gPSAnMSc7CgokaSA9IDA7CgoKZm9yZWFjaCgkYXJyYXkgYXMgJGtleVggPT4gJHgpIHsKCglmb3JlYWNoKCR4IGFzICRrZXlZID0+ICR5KSB7CgkvL9CW0LXQu9Cw0LXRiCDQuNC30LzQtdC90LjRgtGMINC00LDQvdC90YvQuSDRjdC70LXQvdGCINC80LDRgdGB0LjQstCwLCDRgtC+0LPQtNCwINC6INC90LXQvNGDINC4INC+0LHRgNCw0YnQsNC50YHRjy4g0J/QviDRgdC+0L7RgtCy0LXRgtGB0YLQstGD0Y7RidC40Lwg0LrQvtC+0YDQtNC40L3QsNGC0LDQvC4KCQkkYXJyYXlbJGtleVhdWyRrZXlZXSA9ICRpOwoJCQoJCSRpKys7Cgl9Cn0KCmZvcmVhY2ggKCRhcnJheSBhcyAkeSA9PiAkeCkgewoJZm9yZWFjaCAoJHggYXMgJGtleSA9PiAkdmFsdWUpIHsKCQllY2hvICcgJyAuICR2YWx1ZSAuICcgJzsKCX0KCgllY2hvICJcbiI7Cn0=