Mecha CMS

Helper functions.

content

Return file content if input is a valid file path, otherwise return null.

2.2.0

content(string $path);
content(string $path, string $content = null);

Example:

if (null !== content('.\path\to\file.txt')) { … }
if (content('.\path\to\file.txt', 'Yo!')) {
    // File created!
} else {
    // Error!
}