Mecha CMS

Helper functions.

exist

Check the existence of files and folders.

2.2.0

exist(string $path);
exist(array $path);

Example:

if (exist('.\path\to\file.txt')) { … }
if (exist('.\path\to\folder')) { … }

// Check if at least one of the file and folder path is exists
if (exist([
    '.\path\to\file-1.txt',
    '.\path\to\file-2.txt',
    '.\path\to\file-3.txt',
    '.\path\to\folder-1',
    '.\path\to\folder-2',
    '.\path\to\folder-3'
])) { … }