Biz var:
$path = "/home/httpd/html/index.php";
$file = basename($path); // $file is set to "index.php"
$file = basename($path, ".php"); // $file is set to "index"
$file = 'index'; // the result
Nasıl bir çoklu dosya uzantıları sorgulayabilir? Yerine
$file = basename($path, ".php");
gibi bir şey
$file = basename($path, ".php,gif,png,jpeg,css,js,html");
Yani, $path = "/home/image.png"; $file değer 'görüntü' alırsınız.
I pathinfo() ve [filename] kullanmak için uğraş verdik, ama benim sunucu PHP 5.2 desteklemiyor.