The Cusp of Helix

Reference of Intact Case
[delimiterize]

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

Convert compound words connected by a delimiter from 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"