Mecha CMS

Helper functions.

f2p

Convert file name to property name.

2.2.0

f2p(string $value, $accent = false);

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