Laravel get array of filenames from folder - development

Laravel get array of filenames from folder

I am getting an array of filenames from a folder like this…

$files = File::allFiles('myfolder/');

But the resulting array contains pathname as well.

Is there a way of just getting an array of filenames? Or do I need to process each array item and extract the filename from it?



from Laravel Questions and Answers https://laravelquestions.com/laravel/laravel-get-array-of-filenames-from-folder/
via Lzo Media

Comments

Popular posts from this blog

ng-show doesn’t work correct with value boolean

Using PHP and MySQL data to generate PDF letters like in MS Word mailmerge functionality - development

ng-include of inline SVG does not display gradient except in Chrome