You can try extending FilesystemIterator
all you need would be :
echo new NoExtentionIterator(__DIR__);
Class Used
class NoExtentionIterator extends FilesystemIterator {
public function current() {
return pathinfo(parent::current(), PATHINFO_FILENAME);
}
public function accept() {
return parent::current()->isfile();
}
public function __toString() {
return implode("\n", iterator_to_array($this));
}
}