xxxxx
xxxxxxxxxx
xxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
y yo querria
xxxxx
xxxxx
xxxxx
xxxxx
xxxxx
No se si sobra algun for, o algun incremento en los for :S
Código:
<html>
<head>
<meta charset="utf-8">
<title>Activitat 5 Repas</title>
</head>
<body>
<form name="exercic3" method="post" action="repas5.2.php">
Files: <input type="text" name="files">
<br>
Caracter: <input type="text" name="caracter">
<input type="submit"><br>
</form>
</body>
</html>
Código:
<?php
function crear_piramide ($files, $caracter) {
$cadena = null;
for ($x=1; $x<=$files; $x++) {
for ($a = 1 ; $a <= $files; $a++) {
$cadena .= $caracter;
}
echo $cadena."<br />";
}
}
crear_piramide ($files, $caracter);
?>