$sanitizerhyphenCase()

Convert string to be all hyphenated-lowercase (aka kabab-case, hyphen-case, dash-case, etc.)

For example, "Hello World" or "helloWorld" becomes "hello-world".

Usage

// basic usage
$string = $sanitizer->hyphenCase(string $value);

// usage with all arguments
$string = $sanitizer->hyphenCase(string $value, array $options = []);

Arguments

NameType(s)Description
$valuestring
$options (optional)array
  • hyphen (string): Character to use as the hyphen Default:'-'
  • allow (string): Characters to allow or range of characters to allow, for placement in regex Default:'a-z0-9'
  • allowUnderscore (bool): Allow underscores? Default:false

Return value

string


$sanitizer methods and properties

API reference based on ProcessWire core version 3.0.251