Scriptindex.de

[ Menü ]

Home
News
Scripts
Neuzugänge
Suchen
Bücher
Manuals

[ Inhalt ]

Script eintragen
Tutorial eintragen
Newsletter
Umfragen
Link zu uns
Werbung bei uns
Kontakt
Impressum

[ Statistik ]

Hits gesamt: 5203345
Hits Heute: 2
max. Hits (10.07.07): 6964
User Online: 33
Scripts: 2828

[ Partner ]

CodeBase
I.S.U.M.
LUG Bayreuth
PEAR NEWS
PHP Classes

[ Facebook ]

[ Eigene Domain? ]

[ Buchtipp ]

HTML & Web-Publishing Handbuch Gesamtpaket, 2 Bde. m. CD-ROM
HTML & Web-Publishing Handbuch Gesamtpaket, 2 Bde. m. CD-ROM

Manuals > PHP > file_exists

file_exists

(PHP 3, PHP 4 )

file_exists -- Prüft, ob eine Datei oder ein Verzeichnis existiert

Beschreibung

bool file_exists ( string filename)

Gibt TRUE zurück, wenn die mit filename spezifizierte Datei bzw. das Verzeichnis existiert, andernfalls FALSE.

Zum Prüfen von Dateien auf Windows network shares verwenden Sie bitte //computername/share/filename oder \computername\share\filename.

Beispiel 1. Testen, ob eine Datei existiert

<?php
$filename
= '/path/to/foo.txt';

if (
file_exists($filename)) {
    print
"The file $filename exists";
} else {
    print
"The file $filename does not exist";
}
?>

Anmerkung: The results of this function are cached. See clearstatcache() for more details.

Anmerkung: This function will not work on remote files as the file to be examined must be accessible via the servers filesystem.

Siehe auch is_readable(), is_writable(), is_file() und file().


Copyright 1998 - 2009 by I.S.U.M.