The Cusp of Helix

Reference of Intact Case
[hyphenaged]

(string) hyphenaged ($haystack, [$asVendorPrefix = false])

Hyphenate compound words from camelCase/StudlyCaps.

Parameters:

nametypedefaultcaption
$haystackstringString to Convert.
$asVendorPrefixbooleanfalseTreat as vendor-prefix (CSS).

Returns:

  • (string) — Hyphenaged String.

Author:

  • StewEucen

Since:

  • Version 1.0.0

Aliases:

  • trainCase
  • chainCase
  • kebabCase
  • spinalCase

Examples:

use StewEucen\Acts\IntactCase IntactCase::hyphenaged('chainCase') //=> "chain-case" IntactCase::hyphenaged('VendorPrefix', true) //=> "-vendor-prefix" IntactCase::hyphenaged('camelCase', true) //=> "camel-case"