Folder::offsetExists()

Checks if a path exists relative to the folder.

Table of Contents
  1. Description
  2. Example

Description

Folder::offsetExists(mixed $key): bool;

This method is a requirement to be able to implement the ArrayAccess interface and aims to make the object data accessible using array access syntax. You won’t use this method directly, it will be executed automatically when you try to check the existence of a file/folder path with array access syntax. This method checks if a path exists in the folder and will only work when checked using empty() or isset() language construct.

Example

$folder = new Folder('.\path\to\folder');

test(isset($folder['file.txt']));

Folder::offsetExists()

Checks if a path exists relative to the folder.

Folder::size()

Gets the total sizes of files contained in the folder in human readable string format.