Mecha CMS

Helper functions.

p2f

Convert class property name to file name.

2.2.0

Example:

echo p2f('foo');
echo p2f('__foo');
echo p2f('__foo\bar');
echo p2f('fooBar');
echo p2f('foo_bar');
echo p2f('foo_Bar');
echo p2f('FOO_BAR');

Result:

foo
.foo
.foo.bar
foo-bar
foo_bar
foo_-bar
-f-o-o_-b-a-r