Reto Strub: Dateiname aus Pfad extrhahieren

Beitrag lesen

Hallo Markus

Versuchs mal damit:
<?PHP
$pfad_info = pathinfo("/www/users/test_php/zahlen.txt");
echo $pfad_info["dirname"];
echo "<br>";
echo $pfad_info["basename"];
echo "<br>";
echo $pfad_info["extension"];
?>

Als ausgabe bekommst du so:
/www/users/test_php
zahlen.txt
txt

Gruss Reto

PS: Das ist ein Artikel aus SelfPHP