kebab.php
Table of Contents
Functions
- kebab() : string
- Converts a camelCase or PascalCase string into kebab-case (lowercase with hyphens).
Functions
kebab()
Converts a camelCase or PascalCase string into kebab-case (lowercase with hyphens).
kebab(string|null $source) : string
Internally uses the snake()
function with -
as the separator.
Useful for URL slugs, CSS class names, or readable identifiers.
If the input is null
or empty, an empty string is returned.
Parameters
- $source : string|null
-
The input string to transform.
Tags
Return values
string —The kebab-case representation of the input.