(string) compound ($haystack, [$delimiter = '_'])
Concatenate tokens (camelCase|StudlyCaps|snake_case).
Parameters:
name | type | default | caption |
---|---|---|---|
$haystack | string | String to Convert. | |
$delimiter | string | '_' | 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"