The Cusp of Helix

Reference of Intact Case
[tokenize]

(array) tokenize ($haystack, [$delimiter = '_', [$rawFirst = false]])

Explode compound words to tokens.

Parameters:

nametypedefaultcaption
$haystackstringString to Convert.
$delimiterstring'_'Delimiter.
$rawFirstbooleanfalseKeep raw first word in tokens for camelCase.

Returns:

  • (array) — tokens.

Author:

  • StewEucen

Since:

  • Version 1.0.0

Examples:

use StewEucen\Acts\IntactCase IntactCase::tokenize('highClass') //=> ['High', 'Class'] IntactCase::tokenize('highClass', '_', true) //=> ['high', 'Class'] IntactCase::tokenize('StudlyCaps') //=> ['Studly', 'Caps'] IntactCase::tokenize('snake_case') //=> ['snake', 'case'] IntactCase::tokenize('get_utc__day') //=> ['get', 'utc_', 'day']