Hallo Markus,
dafür gibt es eine fertige Funktion:
path = "/home/httpd/html/index.php";
$file = basename($path); // $file enthält den Wert "index.php"
$file = basename ($path,".php"); // $file enthält den Wert "index"
http://www.php.net/manual/de/function.basename.php
Viele Grüße
annA