phpbar.de logo

Mailinglisten-Archive

[php] Feststellen ob eine Datei existiert

[php] Feststellen ob eine Datei existiert

Egon Schmid eschmid_(at)_s.netic.de
Sun, 14 Nov 1999 10:49:59 +0100


Robert Breker wrote:
> 
> so:
> <?php
>   $file = fopen("http://www.garagestudios.de/", "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);
> ?>

Nein, es ging um die Funktion file_exists(). Und die kommt in deinem
Beispiel nicht vor. Steht aber im Manual und im Buch drin.

-Egon


php::bar PHP Wiki   -   Listenarchive