Skip to content

addFolder

Corey Avis edited this page Sep 24, 2026 · 3 revisions

addFolder

Creates a new folder or nested folder hierarchy at the specified path if it does not already exist.

Usage

addFolder(string $folder): bool

Parameters

folder (string) : The name, relative path, or nested directory structure to create (e.g., images or uploads/images).

Return Value

(bool) : Returns true if the folder exists or was successfully created, and false if directory creation failed.

Examples

// Create a single directory
$file->addFolder('images');

// Recursively create nested directorie in one call
$file->addFolder('uploads/images');

Debug Errors

  • No debug errors.

Related Methods

removeFolder | renameFolder


Home | CoreyFile | Structure

Clone this wiki locally