Nuevas NORMAS para el foro

Curso Hacker
Bienvenido(a), Visitante. Favor de ingresar o registrarse.
¿Perdiste tu email de activación? - Julio 09, 2008, 03:26:23
Boton Buscar
Inicio Ayuda Ingresar Registrarse
Visita: Articulos - Juegos Gratis - Da Foros

Comunidad Underground Hispana  |  Programacion  |  Programacion para webmasters  |  Php (Moderadores: RuB [vacaciones], SaTeLuCo)  |  Tema: Abrir un fichero HTML y copiar el contenido a TXT 0 Usuarios y 1 Visitante están viendo este tema. « anterior próximo »
Páginas: [1] Ir Abajo Imprimir
Autor Tema: Abrir un fichero HTML y copiar el contenido a TXT  (Leído 1014 veces)
(¯°»¦«¤ Ave de Fuego ¤»¦«°¯)
Moderador Global
Colaborador
*****
Desconectado Desconectado

Mensajes: 798

(¯°»¦«¤ Ave de Fuego ¤»¦«°¯)


Ver Perfil WWW
« en: Octubre 05, 2004, 04:16:01 »

Este codigo abre un fichero en formato HTML y lee y copia todo su contenido en un fichero de texto. El fichero de texto no hace falta que este creado ya que se crear durante la copia.

Código:
<?php
{
$desc fopen("lineas.htm""r");
$escr fopen("lineas.txt""w") or die ("no se puede crear!!!");
while (!
feof($desc))
{
   
$linea fgetss($desc256""); // FGETSS para leer el fichero
   
echo $linea
   
fputs ($escrtrim($linea)." "); // Escribir el fichero a disco
}
fclose($escr);
fclose($desc);
}
?>
« Última modificación: Octubre 20, 2007, 03:13:27 por gallloo » En línea
Páginas: [1] Ir Arriba Imprimir 
Comunidad Underground Hispana  |  Programacion  |  Programacion para webmasters  |  Php (Moderadores: RuB [vacaciones], SaTeLuCo)  |  Tema: Abrir un fichero HTML y copiar el contenido a TXT « anterior próximo »
Ir a:  


Ranking-Hits
Powered by SMF 1.1.5 | SMF © 2006-2007, Simple Machines LLC