Mecha CMS

Helper functions.

f2c

Convert file name to class name.

2.2.0

Example:

echo f2c('foo');
echo f2c('.foo');
echo f2c('_foo');
echo f2c('foo');
echo f2c('foo-bar');
echo f2c('foo_bar');
echo f2c('foo.bar');
echo f2c('foo._bar');
echo f2c('foo_.bar');

Result:

Foo
\Foo
_Foo
Foo
FooBar
Foo_Bar
Foo\Bar
Foo\_Bar
Foo_\Bar