Signatur
file_exists(string $filename): bool
Beschreibung
Ergebnis wird gecacht — bei Bedarf clearstatcache() nutzen.
Parameter
| Name | Typ | Default | Beschreibung |
|---|---|---|---|
| $filename Pflicht | string | — | Pfad. |
Rückgabewert
Typ
bool
Beschreibung
true wenn existiert.
Beispiele
Basis
<?php
if (!file_exists($path)) {
throw new RuntimeException("Nicht gefunden: $path");
}