<?php
// NL = número de linhas
define("NL", 5);
// NC = número de colunas
define("NC", 5);
$matriz = [];
for ($i = 0; $i < NL; $i++) {
for ($j = 0; $j <NC; $j++) {
$entrada = (int) trim(fgets(STDIN));
if (is_numeric($entrada) && $entrada >= 0) {
$matriz[$i][$j] = $entrada;
}
}
}
for ($i = 0; $i < NL; $i++) {
for ($j = 0; $j <NC; $j++) {
echo $matriz[$i][$j]."\n";
}
}
?>
To embed this project on your website, copy the following code and paste it into your website's HTML: