(string) delimiterize ($haystack, [$delimiter = '_', [$asVendorPrefix = false]])
Convert compound words connected by a delimiter from camelCase/StudlyCaps.
Parameters:
name | type | default | caption |
---|---|---|---|
$haystack | string | String to Convert. | |
$delimiter | string | '_' | Concatenate tokens with between delimiter. |
$asVendorPrefix | boolean | false | Treat as vendor-prefix (CSS). |
Returns:
- (string) — Delimiterized string.
Author:
- StewEucen
Since:
- Version 1.0.0
Aliases:
- snakeCase
- snake_case
- underscored
Examples:
use StewEucen\Acts\IntactCase
IntactCase::delimiterize('camelCase') //=> "camel_case"
IntactCase::delimiterize('StudlyCaps', '_', true)
//=> "_studly_caps"
IntactCase::delimiterize('chainCase', '-') //=> "chain-case"
IntactCase::delimiterize('getUTCDay') //=> "get_utc__day"
IntactCase::delimiterize('UIView') //=> "ui__view"
IntactCase::delimiterize('XML_HTMLRequest') //=> "xml__html__request"