Re: Leer ultima linia fichero con restricciones
| From: | Toad | Date: | Fri, 17 Sep 2004 12:26:30 +0000 |
| Subject: | Re: Leer ultima linia fichero con restricciones | ||
| References: | 1 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-51360@lists.php.net to get a copy of this message | ||
<?php
$a=file("archivo.txt");
$b=sizeof($a)-1;
$ultima_linea = $a[$b];
?>
¿Qué problema hay en hacerlo así?
On Thu, 2004-09-16 at 13:49, Josep Maria Aribau Cano wrote:
> Cómo leer la ultima linia de un fichero sin tener que recorrerlo
> mediante while(!feof()) { fgets()} ni cargandolo en un array con file().
>
> Alguien sabe algun truquito?
>
> Gracias