Mecha CMS

Helper functions.

f2p

Convert file name to class property name.

2.2.0

Example:

echo f2p('foo');
echo f2p('.foo');
echo f2p('.foo.bar');
echo f2p('foo-bar');
echo f2p('foo_bar');
echo f2p('foo_-bar');
echo f2p('-f-o-o_-b-a-r');

Result:

foo
__foo
__foo\bar
fooBar
foo_bar
foo_Bar
FOO_BAR