49 lines
1.0 KiB
PHP
49 lines
1.0 KiB
PHP
<!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>
|