Monday, March 26, 2018

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

No comments:

Post a Comment