Hello everyone.
We have:
$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
How can we query a multiple file extensions? Instead of
$file = basename($path, ".php");
something like
$file = basename($path, ".php,gif,png,jpeg,css,js,html");
So, If $path = "/home/image.png";
$file
will get value 'image'.
I've tryed to use pathinfo()
and [filename]
, but my server doesn't support PHP 5.2.
Thanks.