Mecha CMS

To::file()

Sanitize string into safe file path.

2.0.0Static

To::file(string $in);

Example:

$A = To::file('foo / bar / baz .txt / abc $ def $ ghi .txt');

Result:

$A = 'foo/bar/baz-txt/abc-def-ghi.txt';