Ver Mensaje Individual
  #4 (permalink)  
Antiguo 27/02/2015, 02:52
pacasava9
 
Fecha de Ingreso: febrero-2015
Mensajes: 9
Antigüedad: 9 años, 1 mes
Puntos: 0
Respuesta: Duda php sobre funciones e include

El rpimer ejrcicio es este:
<!DOCTYPE HTML>
<html lang="es">
<head>
<title>ejercicio08</title>
<meta charset=utf-8'>
</head>
<body>
<?php
$lineas=10;
$texto= "Parrafaco abrumador";


function tabla($lineas, $texto ){
echo"<table border='2'>";

for($i=1;$i<=$lineas;$i++){
echo "<tr>";
echo "<td>".$i."</td>";
echo "<td>".$texto."</td>";
echo "</tr>";
}
echo "</table>";
}
tabla($lineas,$texto);
?>
</table>
</body>
</html>
Y el segundo es este:
<!DOCTYPE HTML>
<html lang="es">
<head>
<title>ejercicio09</title>
<meta charset=utf-8'>
<?php
include 'ejercicio08.php';
?>
</head>
<body>
<?php
$lineas1= 5;
$texto1 = "Primer parrafaco abrumador";
$lineas2= 10;
$texto2 = "Segundo parrafaco abrumador";
$lineas3= 20;
$texto3 = "Tercer parrafaco abrumador";
tabla($lineas1,$texto1);
tabla($lineas2, $texto2);
tabla($lineas3, $texto3);
?>
</body>
</html>