Re: AYUDA..Actualizar txt
| From: | Adam Voigt | Date: | Thu, 06 Feb 2003 15:20:07 +0000 |
| Subject: | Re: AYUDA..Actualizar txt | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-134621@lists.php.net to get a copy of this message | ||
Si estoy entendiendo correctamente, usted desea guardar el archivo
cierta longitud quitando
la entrada pasada cada vez que se agrega un nuevo. Si esto está
correcto, usted debe hacer esto:
(Esto está asumiendo sus comentarios es seperated por una rotura de la
línea.)
<?php
$f = fopen("filename","r");
$data = fread($f,filesize("filename"));
fclose($f);
$data = explode("\n",$data);
unset($data[(count($data)-1)]);
$data = implode("\n",$data);
$f = fopen("filename","w");
fwrite($f,$data);
fclose($f);
?>
On Thu, 2003-02-06 at 10:10, Rot Alvarez wrote:
Necesito saber como limpiar o actualizar txt . Resulta q he creado
un chat en flash y php, pero almacena los user y los comentarios en
txt, lo malo es que tengo q limpiarlos desde el server.....q hago.
_____________________________________________________________
Registra gratis tu cuenta email en http://www.exploraiquique.cl
_____________________________________________________________
Select your own custom email address for FREE! Get
you@yourchoice.com w/No Ads, 6MB, POP & more!
http://www.everyone.net/selectmail?campaign=tag
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Adam Voigt (adam@cryptocomm.com)
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc