Mecha CMS

To::kebab()

Convert string into kebab-case.

2.2.0Static

To::kebab(string $in, string $join = '-', $accent = true);

Example:

$A = To::kebab('foo bar baz');
$B = To::kebab('Foo Bar Baz');
$C = To::kebab('Foo Bàr BÀZ');
$D = To::kebab('FooBarBaz');

Result:

$A = 'foo-bar-baz';
$B = 'foo-bar-baz';
$C = 'foo-bar-b-a-z';
$D = 'foo-bar-baz';