<?php
$array[0][0] = '1';
$i = 0;
foreach($array as $y => $x) {
foreach($x as $key => &$value) {
$array[$y][$key] = $i;
$i++;
}
}
foreach ($array as $y => $x) {
foreach ($x as $key => $value) {
echo ' ' . $value . ' ';
}
echo "\n";
}
PD9waHAKJGFycmF5ID0gYXJyYXlfZmlsbCgwLCAxMCwgYXJyYXlfZmlsbCgwLCAxMCwgJ18nKSk7CgokYXJyYXlbMF1bMF0gPSAnMSc7CgokaSA9IDA7Cgpmb3JlYWNoKCRhcnJheSBhcyAkeSA9PiAkeCkgewoJZm9yZWFjaCgkeCBhcyAka2V5ID0+ICYkdmFsdWUpIHsKCQkkYXJyYXlbJHldWyRrZXldID0gJGk7CgkJCgkJJGkrKzsKCX0KfQoKCmZvcmVhY2ggKCRhcnJheSBhcyAkeSA9PiAkeCkgewoJZm9yZWFjaCAoJHggYXMgJGtleSA9PiAkdmFsdWUpIHsKCQllY2hvICcgJyAuICR2YWx1ZSAuICcgJzsKCX0KCgllY2hvICJcbiI7Cn0=