Folder::parent()

Gets the folder’s parent folder.

Table of Contents
  1. Description
  2. Example

Description

Folder::parent(): ?self;

This method returns the folder’s parent folder path as a Folder instance if the folder exists, otherwise, it returns null.

Example

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

$folder = $folder->parent()->path; // Returns `'.\path\to'`

Folder::parent()

Gets the folder’s parent folder.

Folder::size()

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