I'd like to get all .json files in my directory. Then I did that :
foreach (glob("files/my/path/to/*.json") as $file) {
echo $file;
}
But this will print the path and the filename and I can't use getName() function. I'd like to use phalcon function like $file->getName()
etc... as we can do when we are uploading some files like this :
foreach ($this->request->getUploadedFiles() as $file) {
echo $file->getName(), " ", $file->getSize(), "\n";
}
There is a way to do this for the files in directory ? Or maybe I can't do that with Phalon and I have to use basename($file)
?