Beta version

class StringHandler

String handling methods.

Methods

static string
removeDiacritics(string $string)

Remove diacritics characters and replace them with their basic alpha letter.

static string
slugify(string $string)

Transform to lowercase and remplace every non-alpha character with a dash.

static string
classify(string $string)

Transform a string for use as a classname.

static string
cleanForFilename(string $string)

Transform to lowercase and remplace every non-alpha character with an underscore.

static string
variablize(string $string)

Transform to lowercase and remplace every non-alpha character with an underscore.

static string
camelCase(string $string)

Transform to camelcase.

static string
encodeWithSecret(string $value, string $secret)

Encode a string using website security secret.

static string
decodeWithSecret(string $value, string $secret)

Decode a string using website security secret.

static bool
endsWith(string $haystack, string $needle)

No description

static string
replaceLast(string $search, string $replace, string $subject)

No description

Details

at line 46
static string removeDiacritics(string $string)

Remove diacritics characters and replace them with their basic alpha letter.

Parameters

string $string

Return Value

string

at line 64
static string slugify(string $string)

Transform to lowercase and remplace every non-alpha character with a dash.

Parameters

string $string

Return Value

string Slugified string

at line 80
static string classify(string $string)

Transform a string for use as a classname.

Parameters

string $string

Return Value

string Classified string

at line 94
static string cleanForFilename(string $string)

Transform to lowercase and remplace every non-alpha character with an underscore.

Parameters

string $string

Return Value

string Slugified string

at line 111
static string variablize(string $string)

Transform to lowercase and remplace every non-alpha character with an underscore.

Parameters

string $string

Return Value

string Variablized string

at line 128
static string camelCase(string $string)

Transform to camelcase.

Parameters

string $string

Return Value

string

at line 149
static string encodeWithSecret(string $value, string $secret)

Encode a string using website security secret.

Parameters

string $value String to encode
string $secret Secret salt

Return Value

string

Exceptions

EmptySaltException

at line 170
static string decodeWithSecret(string $value, string $secret)

Decode a string using website security secret.

Parameters

string $value Salted base64 string
string $secret Secret salt

Return Value

string

Exceptions

EmptySaltException

at line 191
static bool endsWith(string $haystack, string $needle)

Parameters

string $haystack
string $needle

Return Value

bool

at line 206
static string replaceLast(string $search, string $replace, string $subject)

Parameters

string $search
string $replace
string $subject

Return Value

string