liftkit/token

Library for working with string identifiers

v1.0.3 2018-01-29 15:11 UTC

This package is auto-updated.

Last update: 2024-12-12 01:37:05 UTC


README

A library for working with string identifiers.

Capitalized

use LiftKit\Token\Token;

$token = new Token('some string');

echo $token->capitalized();
// Some String

Uppercase

$token = new Token('some string');

echo $token->uppercase();
// SOME STRING

Lowercase

$token = new Token('SOme stRing');

echo $token->lowercase();
// some string

Camelcase

$token = new Token('some string');

echo $token->camelcase();
// someString

Join

$token = new Token('some string with words');

echo $token->join('$');
// some$string$with$words

Dashed

$token = new Token('some string with words');

echo $token->dashed();
// some-string-with-words

Underscored

$token = new Token('some string with words');

echo $token->underscored();
// some_string_with_words

Combination

$token = new Token('some string with words');

echo $token->uppercase()->underscored();
// SOME_STRING_WITH_WORDS