removeIfExists

Removes a file or directory if it exists.

bool
removeIfExists
(
string file
,
bool recursive = true
)

Parameters

file string

The file or directory to remove.

recursive bool

Whether to recursively remove subdirectories.

Return Value

Type: bool

True if the file or directory was removed, or false otherwise.

Meta