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

How can I solve "laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system"? - development

CORS issue between web/android/ios

Angular.js ng-click with mouse middle button