Re: Capturar codigo
| From: | Pablo E. Siciliano | Date: | Thu, 26 Dec 2002 14:18:07 +0000 |
| Subject: | Re: Capturar codigo | ||
| References: | 1 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-30714@lists.php.net to get a copy of this message | ||
<?php
$file = fopen ("http://www.example.com/",
"r");
if (!$file) {
echo "<p>Unable to open remote file.\n";
exit;
}
while (!feof ($file)) {
$line = fgets ($file, 1024);
/* This only works if the title and its tags are on one line */
if (eregi ("<title>(.*)</title>", $line, $out)) {
$title = $out[1];
break;
}
}
fclose($file);
?>
Lo saqué del manual en CHM. Salió bastante en la lista este tema,
seguramente vas a poder aprender bastante viendo el buscador de phpes.com
----- Original Message -----
From: "Victor Ruiz Huerga" <victor@kernet.es>
To: <lista@phpes.com>
Sent: Thursday, December 26, 2002 11:00 AM
Subject: [PHP-ES] Capturar codigo
> Aupa, ¿sabeis como puedo capturar el codigo de una pagina y mandarlo a un
fichero? es decir coger mipagina.php y mandar el resultado a un fichero, un
saludo
>
> --
> Victor Ruiz Huerga
>
> ---------------------------------------------------------------------
> Archivo On-line: http://www.phpes.com/
> via news: news://news.phpes.com/
> Manual PHP en español: http://www.php.net/manual/es/
> Para dar de baja la suscripción, mande un mensaje a:
> lista-unsubscribe@phpes.com
>