I am currently working through php how to order and is a bit puzzled by the following. Code Part:
$filesInFolder = new DirectoryIterator( $folder);
$file = $filesInFolder->current();
$filename = $file->getFilename();
I (think I) understand what $filesInFolder = new DirectoryIterator( $folder)creates a new instance DirectoryIterator( $folder)in $filesInFolderand what $file = $filesInFolder->current()calls the current()in method in $file.
I do not understand where the method comes getFilename()from $file->getFilename().
Is $file = $filesInFolder->current()creating a new instance of the class in, $fileor is something else happening?
thank
source
share