CodeIgniter Forums

Full Version: Best option to read files
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What is the best option to read images?

Im not sure about, file helper: get_filenames($path)  or maybe directory_map($path).

Using filename I can get the url of the image but it also returns the names of the subdirectories and I do not want this. Using directory_map I can use directory depth.

I dont know what is the best option, I need the most optimal solution. Thanks! Big Grin
Depends, what exactly are you trying to do?

If you are using CI4, in documentation it says you can tell it to leave out the path, setting second attribute to false (which should be false by default?)
Thanks for answering. I'm using CI3, and I want to show galleries of images, each gallery has a subdirectory, in this there is another subdirectory with thumbnails.
Cool. I usually use scandir for all my file-list operations -