note 113821 deleted from function.gettimeofday by aharvey
| From: | aharvey@php.net | Date: | Fri, 06 Dec 2013 01:03:24 +0000 |
| Subject: | note 113821 deleted from function.gettimeofday by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-197800@lists.php.net to get a copy of this message | ||
Note Submitter: IO 1
----
<?php
session_start(); // Necesario para trabajar con variables de sesión
function crear_matriz($filas, $columnas) {
$x = array();
for ($i = 0; $i < $filas; $i++) {
for ($j = 0; $j < $columnas; $j++) {
$x[$i][$j] = rand(1, 10);
}
}
return $x;
}
// $matriz = crear_matriz();
$matriz = crear_matriz($_GET["f"], $_GET["c"]); // Creamos la matriz según
las filas y columnas recibidas del formulario
?>
<html>
<head>
<title>Página 1</title>
</head>
<body>
<table border="1">
<?php
foreach($matriz as $fila) {
print "<tr>";
foreach($fila as $celda) {
print "<td>" . $celda . "</td>";
}
print "</tr>";
}
?>
</table>
<a href="pagina2.php">Página 2</a>
</body>
</html>
<?php
// No hay que olvidar crear las variables de sesión
$_SESSION["matriz"] = $matriz; // para la matriz
$_SESSION["numero1"] = $_GET["x"]; // para el primer número
$_SESSION["numero2"] = $_GET["y"]; // para el segundo número
?>