The Cusp of Helix

Intact Case リファレンス
[delimiterize]

(string) delimiterize ($haystack, [$delimiter = '_', [$asVendorPrefix = false]])

camelCase や StudlyCaps の文字列を、区切り子表記 に変換します。

Parameters:

nametypedefaultcaption
$haystackstringString to Convert.
$delimiterstring'_'Concatenate tokens with between delimiter.
$asVendorPrefixbooleanfalseTreat 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"