mercredi 6 mars 2019

Getting only images from directory

I have this code that gets all the files from the directory i want. I would like to validate that i read only the images in the directory and not all the files.

Is there a way to do it?

$documents = [];
        $filesInFolder = \File::files('/var/www/test/storage/app/public/random_images');
        foreach ($filesInFolder as $path) {
            $documents[] = pathinfo($path);
        }
        return View::make('documents.index')->with('documents', $documents);



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire