public function exists($filename)
    {
        $listing = $this->listDirectoryContents();

        $dirname_info = array_filter($listing, function ($item) use ($filename) {
            return $item['name'] === $filename;
        });

        return count($dirname_info) !== 0;
    }
public function exists($filename)
    {
        $listing = $this->listDirectoryContents();

        $dirname_info = array_filter($listing, function ($item) use ($filename) {
            return $item['name'] === $filename;
        });

        return count($dirname_info) !== 0;
    }
public function exists ( $ filename ) { $ listing = $ this -> listDirectoryContents ( ) ; $ dirname_info = array_filter ( $ listing , function ( $ item ) use ( $ filename ) { return $ item [ 'name' ] === $ filename ; } ) ; return count ( $ dirname_info ) !== 0 ; }
Check that a file exists

@param string $filename
@return bool
Check that a file exists