The Cusp of Helix

Reference of Intact Case
[compound]

(string) compound ($haystack, [$delimiter = '_'])

Concatenate tokens (camelCase|StudlyCaps|snake_case).

Parameters:

nametypedefaultcaption
$haystackstringString to Convert.
$delimiterstring'_'Delimiter.

Returns:

  • (string) — Compound words.

Author:

  • StewEucen

Since:

  • Version 1.0.0

Examples:

use StewEucen\Acts\IntactCase IntactCase::compound(['camel', 'Case']) //=> "camelCase" IntactCase::compound(['Studly', 'Caps']) //=> "StudlyCaps" IntactCase::compound(['XML', 'HTML', 'Request']) //=> "XML_HTMLRequest" IntactCase::compound(['get', 'utc_', 'day']) //=> "get_utc__day" IntactCase::compound(['', 'webkit', 'flex'], '-') //=> "-webkit-flex"