Getting Filenames From Path

Sometimes you have a situation when you want filename without extension and you don’t know extension then you can use pathinfo(). Example File info: $file=’/www/htdocs/inc/lib.inc.php’; $ext = pathinfo($file, PATHINFO_EXTENSION); // php $filename = pathinfo($file, PATHINFO_FILENAME); // lib.inc $dirname = pathinfo($file,…