How do I get only the file name instead of the path + file name?
foreach(glob('./item/*.txt') as $filename){
echo $filename;
}
How do I get only the file name instead of the path + file name?
foreach(glob('./item/*.txt') as $filename){
echo $filename;
}
Use basename($filename)
to get the filename of the file. Check the documentation here: http://php.net/manual/en/function.basename.php