This commit is contained in:
2024-02-15 15:41:01 +01:00
parent bb3a34af71
commit 84e6977fd7
12 changed files with 352 additions and 1 deletions

View File

@@ -0,0 +1,49 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ejercicio6v2_04</title>
</head>
<body>
<?php
$nombre_archivo = "formularios/registro.txt";
$contenido = file_get_contents($nombre_archivo);
$lineas = array();
$archivo = fopen($nombre_archivo, 'r');
while (($linea = fgets($archivo)) !== false) {
$lineas[] = $linea;
}
fclose($archivo);
echo '<table border="2">
<tr>
<th># Index</th>
<th>Nombre</th>
<th>Email</th>
<th>Ruta archivo</th>
</tr>
<tbody>';
foreach ($lineas as $index => $linea) {
$contenido_linea = explode("/_/", $linea);
echo '<tr>';
echo '<td>' . $index + 1 . '</td>';
foreach ($contenido_linea as $contenido) {
echo '<td>' . $contenido . '</td>';
}
echo '</tr>';
}
echo '</tbody>
</table>';
?>
</body>
</html>