(string) delimiterize ($haystack, [$delimiter = '_', [$asVendorPrefix = false]])
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"