Is::folder()

Checks if current input is a valid folder path.

Table of Contents
  1. Description
  2. Example

Description

Is::folder(mixed $value): bool;

This method checks that the input provided is a valid folder path. This method validates the folder path and ensures that the folder exists. This method is a safer alternative to the native is_dir() function as it can accept any type of input to check. For best performance, of course I would still recommend you to just use the native is_dir() function. However, this is only effective if you have ensured that the input to be tested is a string.

Example

if (Is::folder('.\path\to\folder')) {
    // …
}

Is::file()

Checks if current input is a valid file path.

Is::folder()

Checks if current input is a valid folder path.

Is::path()

Checks if current input is a valid path.

Is::void()

Checks for empty string, array and object.