Thanks it works like charm!
I'm now trying to extract the filename without the extension:
$url="http://localhost.com/test.txt";
$url=basename($url);
ereg(".(.+)", $url, $ext);
$name=basename($url,$ext[0]);
but php bugs me with a warning: "Warning: Wrong parameter count for basename() in /usr/local/apache/htdocs/ding/test.php on line 5"
The php documentation says "basename" can have 2 parameters, why is php complaining?